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

unable to generate importmap for @lume/live-code #350

Open
trusktr opened this issue May 1, 2024 · 1 comment
Open

unable to generate importmap for @lume/live-code #350

trusktr opened this issue May 1, 2024 · 1 comment

Comments

@trusktr
Copy link

trusktr commented May 1, 2024

https://generator.jspm.io/#U2NhYGBkDM0rySzJSU1hcMgpzU3Vz8ksS9VNzk9JdTDQM9MzAQB/3w91JAA

It says:

Error: No './dist/themes/smoothy.js' exports subpath defined in https://ga.jspm.io/npm:[email protected]/ resolving thememirror/dist/themes/smoothy.js imported from https://ga.jspm.io/npm:@lume/[email protected]/dist/index.js.

However we can see that the file exists:

https://unpkg.com/thememirror/dist/themes/smoothy.js

Can you please please remove the non-standard restrictions? 🙏

I keep getting blocked by JSPM Generator, and it is getting tiring (just being honest, nothing personal towards you). This isn't a bug in the software, you write great software, but this is an unnecessary restriction that is not based on the ES Module standard.

Please just allow files to be imported! Please!! At this point I think I will have to remove JSPM from my workflows and documentation, because I can't be blocked due to this any more.

I'm really hoping and wishing for it to change.

If the whole stack were open source, I'd already have forked this and solved it. It is totally unnecessary, and not in the spirit of ES Module standards.

@guybedford
Copy link
Member

@trusktr the bug here is actually a strict enforcement of the Node.js module resolution rules.

The package sets an "exports" field of "exports": "./dist/index.js". Per the Node.js module resolution spec, "exports" is encapsulating, so that no other subpaths within the package are allowed to be imported.

If you try doing the same import in Node.js itself it will throw with a similar error.

The solution is to ensure that all of the package exports are listed in "exports" here.

If you want a non-optimizing resolving CDN then try resolving with JSPM generator to jsdelivr via defaultProvider: 'jsdelivr' or another provider. Although typically for compatibility you do want a CDN that applies the standard module resolution rules.

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