esbuild not handling some exports #1665
Unanswered
gavindoughtie
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The esbuild plugin uses the esbuild single file transform API, not the bundler. For module loading the browser module loader is used. The correct syntax to export in the browser in |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My code:
import { GraphQLClient } from "graphql-request";
Works fine with a straight-up esbuild but using the web dev server in watch mode I get:
Uncaught SyntaxError: The requested module '/__wds-outside-root__/1/node_modules/graphql-request/dist/index.js' does not provide an export named 'GraphQLClient'
Inspecting the file in my node_modules I definitely see:
exports.GraphQLClient = GraphQLClient;
graphql-request compiles with commonjs modules
Suggestions on what to tweak in the web dev server config? Here it is:
Beta Was this translation helpful? Give feedback.
All reactions