Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import issue #11

Closed
dkameneck opened this issue Nov 10, 2017 · 9 comments
Closed

Import issue #11

dkameneck opened this issue Nov 10, 2017 · 9 comments

Comments

@dkameneck
Copy link

Hi!
I have problems importing this module.
After installing it via npm and importing it like:

import UkModulusChecking from 'uk-modulus-checking/src'
import UkModulusChecking from 'uk-modulus-checking'
var UkModulusChecking = require('uk-modulus-checking')

I always end up with the same error:

This dependency was not found:

  • fs in ./~/uk-modulus-checking/src/index.js
    To install it, you can run: npm install --save fs

I tried installing fs, but it doesn't change anything.
I am using Vue.js on my project.
Looks like I am missing something to do before importing

@franciscocardoso
Copy link
Contributor

Hi @dkameneck ,

Did you try using the dist file instead?

This should work.

const ukModulusChecking = require("uk-modulus-checking");

new ukModulusChecking({ accountNumber: '<accountNumber>', sortCode: '<sortCode>' }).isValid();

@dkameneck
Copy link
Author

Hey the issue was in 'fs" module.
I tryed running it in browser, which was stupid.
Thanks for your time anyway!

@leotm
Copy link

leotm commented Jan 12, 2018

Hey @dkameneck , just trying to implement this check into a form in .vue page here too.
How did you do it in the end?

@dkameneck
Copy link
Author

dkameneck commented Jan 12, 2018

Hey @leotm !

My problem was with opening that file with rules. I simply converted that .json file to .js.
After that I imported that js file and loaded it without using fs module.
On top of that, you have to change each line of code in this project to work with vue. (atleast I did it).

If you don't understand what I did, let me know, I still have whole project converted to work with vue apps, and without using fs module.

Btw. fs module opens files, which is "forbidden" on client side, otherwise writing trojans would be super easy.

@leotm
Copy link

leotm commented Jan 15, 2018

Thanks @dkameneck ! Which file were you trying to open with which rules?
The only .json i'm seeing is package.json.
If you still have the project to work with Vue without using fs and could attach it here or upload it, that would be great.

@dkameneck
Copy link
Author

Hey @leotm !
I was talking about files data/scsubtab and data/valacdos. I am not sure which format were they before.
Can I email it to you?

@dkameneck
Copy link
Author

ukmodulus.zip

Nvm, didn't notice that i can upload it here at first.
You can use it now by simply importing it:
import UkModulusChecking from './UkModulusChecking.js'

@connorwyatt
Copy link

@franciscocardoso Is there any reason that you wouldn't be open to incorporating such a fix into the main project?

@connorwyatt
Copy link

If you are interested I have a fork that I can create a PR for: master...connorwyatt:master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants