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

v0.13 seems to be gobbling up exceptions #181

Closed
chase-moskal opened this issue Sep 10, 2021 · 5 comments · Fixed by #182
Closed

v0.13 seems to be gobbling up exceptions #181

chase-moskal opened this issue Sep 10, 2021 · 5 comments · Fixed by #182

Comments

@chase-moskal
Copy link

hello! i'm a huge fan of es-module-shims!

today i think i found an issue, where thrown exceptions seem to be "disappearing" under es-module-shims.

  • please see this codepen i made to demonstrate: https://codepen.io/ChaseMoskal/pen/qBjmqva
  • exceptions thrown in a type=module-shim aren't being reported to the console (thrown 1 and throw 2 in the codepen)
  • thrown 3 is a control using type=module

this issue seems to have appeared in v0.13.0, as i quickly tested v0.10, v0.11, and v0.12, where the bug does not reproduce

🍻

@guybedford
Copy link
Owner

@chase-moskal thanks have noticed you've been quite active in a few related projects so thanks for your contributions as well.

You're exactly right, I've posted #182 and will be releasing a patch shortly.

@chase-moskal
Copy link
Author

kind words mean a lot coming from you! i'm inspired by the impact of your work and your incredible development tempo -- you're an absolute madman, fantastic!

i recently rewrote importly, my import map generator cli, which i use in conjunction with es-module-shims in my daily development workflow.

cheers!

@guybedford
Copy link
Owner

That looks really well done, nice to see. Out of interest does it use jspm.dev or jspm.io CDN? If you ever want to combine efforts on the generation side with JSPM generator in future do let me know as well. Although in general more implementations = healthier ecosystem with these things!

@chase-moskal
Copy link
Author

chase-moskal commented Sep 14, 2021

@guybedford

importly can generate maps that point to jspm.io, though i should perhaps add jspm.dev as well. thanks for asking, it's prompted me to investigate how well importly integrates with jspm, and i realize now that jspm operates more like skypack in that it provides bundled entrypoints rather than modules. i jotted down some thoughts about it here in this importly issue chase-moskal/importly#30

in that issue, i also outline a few curiosities i found with jspm cdns, like one entrypoint working on jspm.io but not on jspm.dev -- and some package.json's are retrievable, but some are not — i may open an issue on the jspm repo sometime about these peculiarities

i'd love to collaborate sometime, i think it's really cool how you're driving the industry forward. i think i have an interesting plan to make importly work on-the-fly within the browser, i wonder if jspm generator could do something similar, but without relying like importly does on npm-generated package-lock.json's...

🍻

@guybedford
Copy link
Owner

@chase-moskal generating maps against ga.jspm.io is the preferable generatino target as jspm.dev doesn't have the same backwards compatibility and versioning guarantees.

On jspm.dev, package pathing corresponds to the "exports" field directly. On jspm.io package pathing corresponds to file paths, with only those files publicly exposed by the exports field being available (as well as the package.json, and this is always why package.json is only reliable to lookup on jspm.io since package.json is not exposed by exports and therefore not represented directly on jspm.dev.

That may explain the troubles you were having and hope it helps. As I say I would focus on jspm.io as the target.

The package lock focus is very interesting! I can see ways of incorporating similar API-level possibilities into @jspm/generator, would love to hack on that some time if you're interested.

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

Successfully merging a pull request may close this issue.

2 participants