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
Unable to bundle graphql #14
Comments
Looks like it is partially a problem with the |
Esbuild seems to have no problem bundling it locally. app.tsx: import * as Graphql from "graphql";
console.log(Graphql) $ yarn add esbuild graphql
$ node_modules/.bin/esbuild app.tsx --bundle --outfile=out.js |
Strange... |
Maybe ESM is using an older version of esbuild? |
@FallingSnow thanks, i will figure it out what happened. |
I've worked out that the input going into esbuild is incorrect. Here is effectively the cause of the compiler fail: export const { version,versionInfo,graphql, ....... } = graphql; Note this is passed in at https://github.com/postui/esm.sh/blob/c61d1a05462a1d413f2b69797093e3ae54de7912/server/build.go#L465 An example of what the compiler is trying to compile: const graphql = {
graphql: "test"
};
export const { graphql } = graphql;
export default graphql; Which results in $ node script.js
file:///tmp/script.js:4
export const { graphql } = graphql;
^
SyntaxError: Identifier 'graphql' has already been declared
at Loader.moduleStrategy (node:internal/modules/esm/translators:145:18)
at async link (node:internal/modules/esm/module_job:47:21) Now to find out why esbuild is being passed this. |
@FallingSnow thanks for the details, it is vary useful for me, and i just fixed it! please try it agian: https://esm.sh/graphql. |
Great, it's working great! I'm finally only using |
When traversing to
https://esm.sh/graphql?target=es2018&dev
you getThe text was updated successfully, but these errors were encountered: