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

Import conversion by ?module uses @latest instead of resolved peerDependency #198

Open
natevw opened this issue May 30, 2019 · 2 comments
Open

Comments

@natevw
Copy link

natevw commented May 30, 2019

Preact X's hooks module imports from "preact":

import{options as n}from"preact";

When fetching that with the ?module flag this gets converted to:

import { options as n } from "https://unpkg.com/preact@latest?module";

…which results in broken code, because preact@latest currently redirects to [email protected], and that older version is not at all compatible with the upcoming Preact X hooks implementation.

The package.json for the hooks module specifies:

"peerDependencies": {
  "preact": "^10.0.0-alpha.0"
}

So unpkg should be converting the preact import by specifying preact@^10.0.0-alpha.0 (which currently redirects to [email protected]) for that import, instead of preact@latest.

I mentioned this at #123 (comment) but filing as a separate issue since in this case the peerDependency seems to be getting ignored entirely (despite only specifying a single range).

@mjackson
Copy link
Member

mjackson commented Jul 8, 2019

Is this a dup of #197?

EDIT: Main reason I'm asking is because preact's hooks module uses a nested package.json for resolution, which we don't currently support.

@natevw
Copy link
Author

natevw commented Jul 16, 2019

@mjackson Hmm, it may be related i.e. if the reason this is happening is because of the nested package? Otherwise it would be a separate issue related to which version it ends up picking.

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