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

Package works when pinned from JSPM but not when downloaded #231

Closed
jclusso opened this issue Jan 10, 2024 · 2 comments
Closed

Package works when pinned from JSPM but not when downloaded #231

jclusso opened this issue Jan 10, 2024 · 2 comments

Comments

@jclusso
Copy link

jclusso commented Jan 10, 2024

I'm not sure what the issue with this is, but when you pin local-time and it downloads the file to vendor, you get the following error.

import LocalTime from 'local-time'
LocalTime.start()
Uncaught SyntaxError: The requested module 'local-time' does not provide an export named 'default' (at application-d388861d540215dfe6992c273c62929501af1895.js:14:8)

However, in an older project I have it pinned like this, and it works fine.
pin "local-time", to: "https://ga.jspm.io/npm:local-time@2.1.0/app/assets/javascripts/local-time.js"

I even tried copying the the file from JSPM to vendor and still had the same issue. Trying to understand if this is an issue with importmaps or local-time.

@josefarias
Copy link
Contributor

josefarias commented Jan 15, 2024

@jclusso I think this might've been an issue with the previous version of local-time.

I've just cut a new release of local-time, could you try installing that, see if it works for you now? Make sure it's at least version 3.0.2, please.

If not, I'd suggest closing this issue and opening one in https://github.com/basecamp/local_time/issues until we can determine this is a problem with importmap-rails. Which I'm not sure it is.

@jclusso
Copy link
Author

jclusso commented Jan 15, 2024

Thanks @josefarias! This was the issue.

@jclusso jclusso closed this as completed Jan 15, 2024
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

No branches or pull requests

2 participants