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

preact/debug breaks on preact/devtools import #2867

Closed
brion-fuller opened this issue Dec 14, 2020 · 1 comment
Closed

preact/debug breaks on preact/devtools import #2867

brion-fuller opened this issue Dec 14, 2020 · 1 comment

Comments

@brion-fuller
Copy link

Reproduction

https://codesandbox.io/s/preactdebug-esm-7165v?file=/index.html

Steps to reproduce

Using the link above, you can see that nothing is rendered on the page.
The error message that I get is a 404 on https://unpkg.com/[email protected]/devtools?module.
I believe this is because of trying to use scope like naming without scoping. So preact/devtools instead of @preact/devtools. unpkg is picking this up as a path name instead and not reading from the package.json.

Expected Behavior

https://unpkg.com/preact/devtools should resolve to https://unpkg.com/[email protected]/devtools/dist/devtools.module.js?module

Actual Behavior

https://unpkg.com/preact/devtools resolves to https://unpkg.com/[email protected]/devtools?module

@marvinhagemeister
Copy link
Member

marvinhagemeister commented Dec 14, 2020

This is a known error in the module resolution code of unpkg. This can't be fixed on our end.

See:

The recommended solution is to use a CDN which supports proper module resolution, like https://npm.reversehttp.com/

// preact and preact/hooks: 10.5.7, and htm/preact: 3.x.x:
import { html, render } from 'npm.reversehttp.com/[email protected],[email protected]/hooks,htm@3/preact';

Closing, because this is a duplicate of #2564 and we can't solve it on our end.

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