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

Always specify file extensions in import statements #330

Open
queengooborg opened this issue Sep 8, 2022 · 0 comments · May be fixed by #331
Open

Always specify file extensions in import statements #330

queengooborg opened this issue Sep 8, 2022 · 0 comments · May be fixed by #331

Comments

@queengooborg
Copy link

Upon migrating my codebase to ESM, I ran into an issue with Prism imports:

ERROR in ./editor/js/css-examples-libs.js 1:0-50
Module not found: Error: Can't resolve 'prismjs/components/prism-core' in '/Users/queengooborg/Developer/Gooborg/mdn-bob/editor/js'
Did you mean 'prism-core.js'?
BREAKING CHANGE: The request 'prismjs/components/prism-core' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

This seems to be due to the fact that the plugin specifies imports without the file extension. To prevent this issue, the file extension should always be specified.

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

Successfully merging a pull request may close this issue.

1 participant