Comments (8)
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.
from esm.sh.
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
from esm.sh.
Looks like it is partially a problem with the graphql
package and how they wrote it
from esm.sh.
Strange...
from esm.sh.
Maybe ESM is using an older version of esbuild?
from esm.sh.
@FallingSnow thanks, i will figure it out what happened.
from esm.sh.
@FallingSnow thanks for the details, it is vary useful for me, and i just fixed it! please try it agian: https://esm.sh/graphql.
from esm.sh.
Great, it's working great! I'm finally only using esm.sh
and denoland.
from esm.sh.
Related Issues (20)
- Failed to import (types) - https://esm.sh/v135/[email protected]/ HOT 3
- Failed to import - jiti HOT 1
- Failed to import - Quill
- Failed to import - `/_virtual/esm.sh/v134/[email protected]/denonext/css/preflight.css` HOT 2
- The import is successful, but it seems to be built an error
- Failed to import gh/web-eid/web-eid.js HOT 2
- Support aliasing to github repo HOT 2
- Failed to import - https://esm.sh/gh/eavidy/test_case/main.js (This repository is a simple example) HOT 1
- Failed to import - @vuepic/vue-datepicker
- `esm.sh init` throws `Cannot convert undefined or null to object` HOT 1
- Failed to import - `@ruby/[email protected]/dist/browser` HOT 3
- Use Web Cryptography API for wbn-sign-webcrypto, crypto-browserify throws for subtle, doesn't implement Ed25519 HOT 10
- Failed to import - @web3-storage/w3up-client HOT 1
- Failed to import - [email protected]/dist/ort.wasm.min.js
- Failed to import - @automerge/automerge-wasm
- Wrong X-Typescript-Types url for `@vueuse/shared` HOT 1
- Failed to import - primereact (alias cannot contain slashes) HOT 2
- Feature request - download lists HOT 5
- Invalid response status code
- Failed to import - @mui/icons-material/DeleteOutline HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esm.sh.