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 from jspm includes relative link to non-existent file #2584

Open
onslauth opened this issue Jan 27, 2025 · 3 comments
Open

Package from jspm includes relative link to non-existent file #2584

onslauth opened this issue Jan 27, 2025 · 3 comments

Comments

@onslauth
Copy link

Hi,

I am using rails-7 to install qr-code-styling with importmap. When it installs qr-code-styling it also installs https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/buffer.js which contains the following:

import{d as r}from"../../_/C7GZrc4O.js";const a=r();a.Buffer;a.SlowBuffer;a.INSPECT_MAX_BYTES;a.kMaxLength;var f=a.Buffer;var e=a.INSPECT_MAX_BYTES;var t=a.kMaxLength;export{f as Buffer,e as INSPECT_MAX_BYTES,a as default,t as kMaxLength};

Obviously this causes an error as there is no such file ../../_/C7GZrc4O.js.

Is this a bug or is the 'buffer.js' somehow invalid?

@guybedford
Copy link
Member

The file ../../_/C7GZrc40.js very much does exist - https://ga.jspm.io/npm:@jspm/[email protected]/_/C7GZrc4O.js.

I think this might be related to the problem with the Rails implementation of downloading import maps, which doesn't support downloading packages as folders of modules, only as single files.

@onslauth
Copy link
Author

Would the work around be to 'pin' the entire '[email protected]'? Or is there a better solution?

@guybedford
Copy link
Member

I think treating packages as folders to download as opposed to files using the folder API (https://jspm.org/cdn/api#download) remains the fix for Importmap Rails, which I have suggested before. Someone just needs to work on a PR for that.

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