Skip to content

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

@Sjeiti

Description

@Sjeiti

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions