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

[generator] TypeError: Failed to fetch dynamically imported module: https://ga.jspm.io/npm:@babel/core@7.23.2/lib/index.js #326

Open
trusktr opened this issue Jan 16, 2024 · 3 comments

Comments

@trusktr
Copy link

trusktr commented Jan 16, 2024

generator fails to generate for pota package:

https://generator.jspm.io/#M2NhYGBkDM0rySzJSU1hKMgvSXQw0DPRM7EAANczdlIaAA

@guybedford
Copy link
Member

The error is obscure, and that is due to an unrelated bug. Specifically that it's trying to do TypeScript parsing. I've created jspm/generator#340 to disable TypeScript parsing in the generator.

The package issue in this case though is that they have published raw .ts and .tsx files to npm that are being loaded, which won't be supported in browsers of course.

Once jspm/generator#340 is landed and released in the generator app, the error should at least improve a bit.

@trusktr
Copy link
Author

trusktr commented Jan 27, 2024

The pota package does not publish TypeScript files. In fact, it is written in plain JS, and the .d.ts declaration files are generated (those are the only files generated, the source is .js). The exports field points to .js files:

https://unpkg.com/browse/pota@0.7.77/package.json

I can load pota by writing a manual importmap that points to unpkg:

<script type="importmap">
	{
		"imports": {
			"solid-js": "https://unpkg.com/solid-js@1.8.11/dist/solid.js",
			"solid-js/dist/solid.js": "https://unpkg.com/solid-js@1.8.11/dist/solid.js",
			"solid-js/web": "https://unpkg.com/solid-js@1.8.11/web/dist/web.js",
			"solid-js/html": "https://unpkg.com/solid-js@1.8.11/html/dist/html.js",
			"solid-js/store": "https://unpkg.com/solid-js@1.8.11/store/dist/store.js",

			"pota": "https://unpkg.com/pota@0.7.65/src/exports.js",
			"pota/": "https://unpkg.com/pota@0.7.65/"
		}
	}
</script>

Live demo on CodePen

@guybedford
Copy link
Member

That was not the case for the 0.4 version of Pota, so it was likely a publishing mistake that they published JSX. Retesting on the latest version it appears to generate correctly now -

https://generator.jspm.io/#M2NhYGBkDM0rySzJSU1hKMgvSXQw0DPXM7cEAGz/6RwaAA

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