Comments (12)
import * as Request from "https://esm.sh/graphql-request";
console.log(Request);
i got the output:
Module {
ClientError: undefined,
GraphQLClient: undefined,
default: [Function: Pe],
gql: undefined,
rawRequest: undefined,
request: undefined,
[Symbol(Symbol.toStringTag)]: "Module"
}
seems it is the esbuild issue, i'm not sure what happened, will check the esbuild api later, thanks @FallingSnow
from esm.sh.
The skypack example you gave doesn't seem to run properly
The fact that it is importing /language/printer
instead of /language/printer.js
is a little strange...
from esm.sh.
fixed
from esm.sh.
I was looking through the bundle (yes I know it's not that good of a thing to do) but it seems Bt
is never defined. bt
is but JavaScript references are case sensitive I believe. Could that be the case?
from esm.sh.
Ok... oddly enough this does work though.
import {graphql} from "https://cdn.skypack.dev/graphql";
import request, {gql} from "https://cdn.skypack.dev/graphql-request";
console.log(graphql, gql);
I can upload a test repo if you'd like.
from esm.sh.
Ok you're right. In fact none of the others are defined either (At, _t, Ft, jt)...
from esm.sh.
I guess what's next is to try a local esbuild example.
from esm.sh.
Local esbuild does work correctly.
app.ts
import {gql} from "graphql-request";
console.log(gql);
$ yarn add esbuild graphql-request
$ ./node_modules/.bin/esbuild app.ts --bundle --platform=node --outfile=out.js
$ node out.js
[Function: gql2]
from esm.sh.
Yeah, seems to be a problem with the esbuild minifier. We should probably file a bug report there
from esm.sh.
@FallingSnow can you please try ./node_modules/.bin/esbuild app.ts --bundle --platform=web --outfile=out.js
from esm.sh.
Export is good still. Btw --platform=browser
is the correct flag. Are we using the same esbuild version?
$ ./node_modules/.bin/esbuild --version
0.8.31
from esm.sh.
from esm.sh.
Related Issues (20)
- Invalid response status code
- Failed to import - @mui/icons-material/DeleteOutline HOT 1
- Failed to init CLI on Deno HOT 1
- Feature request - SSE for package new version HOT 2
- No versions available for esm-node-services HOT 9
- "esmLexer: invalid syntax, require javascript/typescript" on valid file HOT 5
- Not possible to import a React client component in Next.JS via esm.sh
- Use custom node polyfill via `alias` and `external` query
- @observablehq/plot prototypes are missing a method due to skipped side effects
- Support GitHub Gists
- Failed to import - d3
- Failed init cli on NPM HOT 7
- Support importing modules from jsr.io HOT 1
- how to get react profiling version
- Failed to import - basehub/react - shows 500 Internal Server Error. - on commit
- Failed to import - @mui/material HOT 6
- Failed to import - openlayers
- All previously built urls are failing HOT 1
- Question: why don't you use yarn pnp
- Self hosted - 405 Response using the npm.pkg.github.com registry HOT 3
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.