rails/importmap-rails

Package works when pinned from JSPM but not when downloaded

jclusso opened this issue · 2 comments

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.

@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.

Thanks @josefarias! This was the issue.