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)
- Failed to set `react` as external dependency
- Failed to set `@use-gesture/core/action` as external dependency HOT 2
- Failed to import - jotai/utils
- Invalid hook call with @react-three/fiber HOT 2
- Failed to import - gh/streamlit/[email protected]/component-lib
- Failed to import - https://esm.sh/@mdxeditor/[email protected]
- No space left on device HOT 1
- Mechanism logic update for managing files HOT 2
- Failed to import - https://esm.sh/@adobe/[email protected]?external=react,react-dom,mobx,mobx-react,@react-spectrum/provider,@react-spectrum/theme-default,@babel/runtime&bundle
- Failed to import - @privy-io/react-auth
- Failed to import bcrypt HOT 2
- Failed to import jsx-runtime HOT 2
- Failed to import - react@rc in development mode HOT 4
- esbuild target: User-Agent not working HOT 4
- Failed to import - @mendable/firecrawl-js
- Failed to import @vercel/og
- `esm.sh` is likey to fail to load the latest version of JSR packages
- Deploy v136? HOT 1
- The "deps" query parameter is not honored fully deep
- Whitelisting broken? - Failed to import - @sentry/astro 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.