You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The file at the URL: http://example.com/deps/PKG1/file.js
Will be loaded twice when using es-module-shim with a "shimmed import map and module."
This will result in the console log message "File Loaded" appearing twice.
But will only be loaded once with native handling Module handling in browsers, and only one console log message will appear.
In the scenario I had where this came into play, I was seeing an error in a file that looked like this throw an error like this:
importsomeVarfrom'PKG1/file.js';constf=someVar;// Error: Uncaught (in promise) ReferenceError: Cannot access 'someVar' before initialization
I am still not sure why I would be getting someVar is not initialized, but I assume it is a confluence of factors regarding the use of top level await, import.meta.resolve, and the import() function.
I realize this is an edge case, so I am altering our code to do file normalization, but wanted to make sure it at least got reported for the next person.
The text was updated successfully, but these errors were encountered:
I have been tracking down an issue with es-module-shim and some sporadic behavior in an app that we are migrating from AMD to ESM.
I have a module located at the URL:
http://example.com/deps/PKG1/file.js
With the contents:
And an import-map that looks like:
Located at
http://example.com/index.html
If I have a module that contains this:
The file at the URL:
http://example.com/deps/PKG1/file.js
Will be loaded twice when using es-module-shim with a "shimmed import map and module."
This will result in the console log message "File Loaded" appearing twice.
But will only be loaded once with native handling Module handling in browsers, and only one console log message will appear.
In the scenario I had where this came into play, I was seeing an error in a file that looked like this throw an error like this:
I am still not sure why I would be getting someVar is not initialized, but I assume it is a confluence of factors regarding the use of top level await, import.meta.resolve, and the import() function.
I realize this is an edge case, so I am altering our code to do file normalization, but wanted to make sure it at least got reported for the next person.
The text was updated successfully, but these errors were encountered: