-
Notifications
You must be signed in to change notification settings - Fork 125
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
Browser error "The requested module 'local-time' does not provide an export named 'default'" #162
Comments
Some days it feels like when you open the issue, that's when you find the page that answers your problem. There appears to be a bug, and I found some tips on #113 that worked. Specifically, I changed my pin to |
@epugh I see in your PR you have multiple configurations that seem to be conflicting with each other. The latest version of your PR has you linking the library in both your sprockets manifest and in importmaps.rb. In sprockets, you're linking the UMD build, while in importmaps you're linking the vendored version, which is the ESM build. These are not meant to work together, you should pick one instead. Further, in the image you shared, you're linking to the UMD version from your importmap. I'd assume that's from a previous version of the PR. The problem in #113 should not be present anymore. We use the standard configuration in HEY, in production. And the fix in #113 (EDIT: meaning the new release, not the temporary renaming fix) seems to have worked for other reporters. I think this points to a misconfiguration in your app. You should be able to just have this in your importmap: pin "local-time" # @3.0.2 Plus the vendored ESM build in Closing for now but let me know if you find a way to reproduce in a more minimal setup that doesn't potentially conflict with loading the library. I'll gladly take another look. Note that you can also choose to use sprockets without importmaps following these instructions: #161 |
Thanks for spotting the umd vs esm issue. I changed the order to first having |
I'm updating local_time for my opensource project Quepid, and this is the first time enabling importmaps. I am attempting to run sprockets and importmaps next to each other, so for importmaps I have a
application2.js
file.In chrome I get this error in the console:
While in Firefox I get:
Both refer to this line in my
application2.js
file:Looking at the rendered HTML it seems to make sense:
![image](https://private-user-images.githubusercontent.com/22395/301638985-3e8d7540-74cb-4b71-88d9-8e508a68a91d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNzYwMDcsIm5iZiI6MTczOTA3NTcwNywicGF0aCI6Ii8yMjM5NS8zMDE2Mzg5ODUtM2U4ZDc1NDAtNzRjYi00YjcxLTg4ZDktOGU1MDhhNjhhOTFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDA0MzUwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkNjA4ZmRiZGU2ZDk4MjNhNzRjNjcxY2U0ZGEzMTY5ZWNjZDZjMjhlZjc4YWE3MjUxMDZjNDE2ZTZlMzYyNzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5JA9I_YhLCtHbCkfEvCKFVG930hZ9xx3pBHD1yO1Cg4)
The PR that demonstrates my changes is o19s/quepid#939
Would love any advice!
The text was updated successfully, but these errors were encountered: