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

Unexplained esbuild error #77

Closed
jaydenseric opened this issue Jun 25, 2021 · 6 comments
Closed

Unexplained esbuild error #77

jaydenseric opened this issue Jun 25, 2021 · 6 comments

Comments

@jaydenseric
Copy link

I'm struggling to figure out what the problem is with this URL:

https://esm.sh/react-waterfall-render@2.0.0/public/waterfallRender.js?target=deno

It result in a HTTP 500 status:

/* esm.sh - error */
throw new Error("[esm.sh] " + "unexpected esbuild output");
export default null;

Is this code not compatible with esm.sh, or is this a bug with the service? There isn't an obvious bundling error, as that package actually has a passing esbuild bundle test:

https://github.com/jaydenseric/react-waterfall-render/blob/fcbcb036f136a0c28d5ec551556ebac25040355d/test/bundle.test.mjs#L7-L26

I've tried the test with a bunch of esbuild versions (all passing) in case the esm.sh service hasn't deployed the latest one yet:

https://github.com/postui/esm.sh/blob/e65ba3e5cbccd27c9ad20f2817594830c121ae76/go.mod#L6

Skypack seems to deal with it fine:

https://cdn.skypack.dev/react-waterfall-render@v2.0.0/public/waterfallRender.js

Although it results in a runtime error that process is undefined, because skypack apparently doesn't do process.env.NODE_ENV based code elimination by default, which the react/jsx-runtime dependency contains:

https://unpkg.com/react@17.0.2/jsx-runtime.js

Here is the source in case something jumps out as being incompatible with esm.sh:

https://github.com/jaydenseric/react-waterfall-render/blob/v2.0.0/public/waterfallRender.js

@ije
Copy link
Member

ije commented Jun 25, 2021

@jaydenseric thanks, i will look into it.

@jaydenseric
Copy link
Author

@ije what was the unexpected esbuild output, so I can investigate? Maybe it's something simple. I'm blocked at the moment.

@jaydenseric
Copy link
Author

Another clue; importing the same thing via the package index instead of a deep import appears to work:

- import waterfallRender from "https://esm.sh/react-waterfall-render@2.0.0/public/waterfallRender.js";
+ import { waterfallRender } from "https://esm.sh/react-waterfall-render@2.0.0/public/index.mjs";

We need deep imports to work though.

@jaydenseric
Copy link
Author

Getting desperate, so many packages I depend on have the same error. Here's another example:

https://esm.sh/graphql-react@15.0.0/public/Cache.js

@ije
Copy link
Member

ije commented Jun 30, 2021

I will fix it asap!

@ije
Copy link
Member

ije commented Aug 7, 2021

fixed in v44 branch

@ije ije closed this as completed Aug 7, 2021
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