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

Depended module incorrect redirect when use deps option #476

Closed
Justinidlerz opened this issue Dec 27, 2022 · 14 comments
Closed

Depended module incorrect redirect when use deps option #476

Justinidlerz opened this issue Dec 27, 2022 · 14 comments
Labels
browser Not working in Browser

Comments

@Justinidlerz
Copy link
Contributor

Justinidlerz commented Dec 27, 2022

Failing module

react-dom / graphQL

import Loading from 'https://esm.sh/[email protected]/es2022/AntdExtends/Loading?bundle&deps=react@18,react-dom@18';

import errorLink from 'https://esm.sh/@apollo/[email protected]/link/error?bundle&deps=react@18,react-dom@18'

The module will load this module:

https://esm.sh/[email protected]/X-ZC9yZWFjdEAxOC4yLjA/es2022/react-dom.js

Since the service upgrade to V100, failed to load some dependencies when setting the deps option for the module.

The correct URL must includes /v100: https://esm.sh/v100/[email protected]/X-ZC9yZWFjdEAxOC4yLjA/es2022/react-dom.js

Error message

After onload I got this:

throw new Error("[esm.sh] " + "parseCJSModuleExports: Package path ./X-ZC9yZWFjdEAxOC4yLjA/es2022/react-dom is not exported from package /tmp/esm-build-cc60c8eed435100cff08af96cf604ff44c4d6cee-9189bf32/node_modules/react-dom (see exports field in /tmp/esm-build-cc60c8eed435100cff08af96cf604ff44c4d6cee-9189bf32/node_modules/react-dom/package.json)");
export default null;

Additional info

  • esm.sh version: v100
  • Browser version: *
@Justinidlerz Justinidlerz added the browser Not working in Browser label Dec 27, 2022
@Justinidlerz Justinidlerz changed the title Failed to import - react-dom / graphQL Depended module incorrect redirect when use deps Dec 27, 2022
@Justinidlerz Justinidlerz changed the title Depended module incorrect redirect when use deps Depended module incorrect redirect when use deps option Dec 27, 2022
@PeterBLITZ
Copy link

The error is present in other packages, even without any options.

e.g., https://esm.sh/[email protected]/es2022/crypto-browserify.js

@ije
Copy link
Member

ije commented Dec 27, 2022

https://esm.sh/[email protected]/es2022/crypto-browserify.js

this url is not correct (missing /v100 prefix), where you got it?

@ije
Copy link
Member

ije commented Dec 27, 2022

import Loading from 'https://esm.sh/[email protected]/es2022/AntdExtends/Loading?bundle&deps=react@18,react-dom@18';

this you need to remove es2022 part

@Justinidlerz
Copy link
Contributor Author

Justinidlerz commented Dec 27, 2022

But es2022 is the server adds, I just only do this on my code:

https://esm.sh/aftership-sdui-library/AntdExtends/Loading?bundle&deps=react@18,react-dom@18

image

And that works on previous versions' servers, we do not modify any codes

@ije
Copy link
Member

ije commented Dec 27, 2022

Screenshot 2022-12-27 at 18 45 21

i see, will look into it. thanks!

@Justinidlerz
Copy link
Contributor Author

Justinidlerz commented Dec 27, 2022

Wow, what is this tool? looks so cool, could you share it with me?

image

@ije
Copy link
Member

ije commented Dec 27, 2022

Wow, what is this tool? looks so cool, could you share it with me?

image

by deno info command

@ije ije closed this as completed in b1f925f Dec 27, 2022
@ije
Copy link
Member

ije commented Dec 27, 2022

i found the bug, will deploy to prod after testing

@Justinidlerz
Copy link
Contributor Author

Hello @ije, The react-dom is back to normal, but graphql still failed

image

@ije
Copy link
Member

ije commented Dec 27, 2022

it's cached, i need to release v101 to fix this, please wait

@Justinidlerz
Copy link
Contributor Author

Okay, thanks

@PeterBLITZ
Copy link

PeterBLITZ commented Dec 27, 2022

https://esm.sh/[email protected]/es2022/crypto-browserify.js

this url is not correct (missing /v100 prefix), where you got it?

I have a URL like this: https://esm.sh/v100/[email protected]/es2022/crypto-browserify.bundle.js, but inside, you can find incorrect relative import import br from"/[email protected]/es2022/events.bundle.js"; without /v100 prefix.

Unlike v99 https://esm.sh/v99/[email protected]/es2022/crypto-browserify.bundle.js, where we can find relative imports with prefix import __events$ from "/v99/[email protected]/es2022/events.bundle.js";

@ije
Copy link
Member

ije commented Dec 27, 2022

@PeterBLITZ i believe v101 fixed this issue

@PeterBLITZ
Copy link

@PeterBLITZ i believe v101 fixed this issue

Yup. Thank you)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser Not working in Browser
Projects
None yet
Development

No branches or pull requests

3 participants