-
Notifications
You must be signed in to change notification settings - Fork 864
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
ES6 import fails #60
Comments
I encountered this issue in react too. I managed to get it working using find/replace in
I'm honestly not very familiar with zxing.js so I don't know why this works. |
Not sure why webbrowser targeted libs should make any use of 'fs' but your absolutely right that this was the problem! |
add this to your webpack config:
Like in pugjs/pug-loader#8 (comment) |
alhamdulillah bisa :) |
I'm trying to import the library via an ES6 import statement
import InstaScan from 'instascan'
, which throws the following error:Is it just my npm setup beeing all messed up again, or is this lib not intended to be used that way?
Probably this is just webpack messing things up...
To reproduce create a simple react based app with one of the create-react-scripts, start the dev server and try to import and/or require it from there.
Windows 10 1607 build 14393.1480
Npm 5.03
The npm module
fs
is installed globally and locally in the project's folder.The text was updated successfully, but these errors were encountered: