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
Module import doesn't work in the latest Chrome #4203
Comments
This is not just a chrome thing. As far as i know, the es6 module spec requires a file name in the FromClause and not just a string. Rollup and Webpack are working fine without the file extension, but that's only to make bundling easier. And overall it's better to avoid letting any loader guess the extension, so yeah, the FromClauses should really be full file names. |
Would be really good to get this sorted as neither the source version nor the compiled version works when using a module import in browsers which support it. It should be a quick fix of just adding file extensions to the imports. |
This would be best solved by a community-driven PR! |
here ya go |
This would be great for usage in a Polymer webcomponent. Now, I do not succeed to use moment js in a standard ES6 webcomponent due to this. |
Is this still an issue? I'm worried adding file extensions will cause Moment.js to break for some other subset of users ... |
I think this is a duplicate of #4713 |
Description of the Issue and Steps to Reproduce:
Latest version of Chrome declares native modules import support. But the feature requires full module file name to be provided (including ".js" extension).
In the library code "import ..." entries don't have ".js" extensions which results 404 errors in the browser.
FYI: One thing that might (and does on some platforms) hide this issue is a web-server configuration.
Apache web-server on OSX seems has "MultiViews" setting enabled by default (which makes the server find "moment.js" file if there is no "moment" file found), but on Ubuntu, for example, this web-server option is disabled which make the module loading fail.
Environment:
Chrome 61.0.3163.100 (64 bit) on Ubuntu 16.04
moment.js version is 2.18.1
The text was updated successfully, but these errors were encountered: