Skip to content
New issue

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

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

Already on GitHub? # to your account

es6 import error (SyntaxError: expected expression, got '<') #37

Open
Sjeiti opened this issue Feb 28, 2020 · 0 comments
Open

es6 import error (SyntaxError: expected expression, got '<') #37

Sjeiti opened this issue Feb 28, 2020 · 0 comments

Comments

@Sjeiti
Copy link

Sjeiti commented Feb 28, 2020

When doing a regular es6 import I got the error SyntaxError: expected expression, got '<' Animated_GIF.worker:1.

This is due to the fact that the script is trying to load a missing webworker from the root and the index.html is served.

The default es6 is import Animated_GIF from 'animated_gif' but package.json main points to the src file which does not have the webworker combined.
One solution is to point to the correct file with import Animated_GIF from 'animated_gif/dist/Animated_GIF.min'. The other is to update the package.json main.

I could do a pull request but do I update package.json or update README.md with the correct es6 import? The former would require an npm publish as well.

ps: npm install node_modules should only contain the dist js, it might be wise to add files to package.json as well.

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

No branches or pull requests

1 participant