Error: Option 'bundler' can only be used when 'module' is set to 'es2015' or later.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- graphql, next.js, typescript
Research direction
Start by reproducing the failure with the provided create-next-app steps, the .graphclientrc.yml configuration, and npx graphclient build. Trace the GraphClient schema-generation path and its TypeScript module-resolution handling; done means the build succeeds with "moduleResolution": "bundler" without requiring users to switch to "node".
Written by the indexing model from the issue text.
Description
If I follow the steps of adding Graph Client to a fresh install of Next.js with TypeScript, running npx graphclient build yields the following output:
💡 GraphClient Cleaning existing artifacts
💡 GraphClient Reading the configuration
💡 GraphClient Generating the unified schema
💥 GraphClient - uniswapv2 Failed to generate the schema Error: Failed to fetch introspection from https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2: error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later.
at GraphQLHandler.getMeshSource (/Users/schmidsi/Development/@schmidsi/module-resolution-test/node_modules/@graphql-mesh/graphql/cjs/index.js:339:23)
at async /Users/schmidsi/Development/@schmidsi/module-resolution-test/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:128:28
at async Promise.allSettled (index 0)
at async getMesh (/Users/schmidsi/Development/@schmidsi/module-resolution-test/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:123:5)
at async Object.handler (/Users/schmidsi/Development/@schmidsi/module-resolution-test/node_modules/@graphql-mesh/cli/cjs/index.js:311:53)
💥 GraphClient Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
at getMesh (/Users/schmidsi/Development/@schmidsi/module-resolution-test/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:162:15)
at async Object.handler (/Users/schmidsi/Development/@schmidsi/module-resolution-test/node_modules/@graphql-mesh/cli/cjs/index.js:311:53)
The error can be fixed with changing "moduleResolution" from "bundler" to "node". That being said, this might not be obvious for a lot of developers. Is it possible to make Graph Client work with "moduleResolution": "bundler"?
Steps to reproduce
hint: Content of graphclientrc.yml
npx create-next-app@latest
✔ What is your project named? … module-resolution-test
✔ Would you like to use TypeScript? … No / Yes
✔ Would you like to use ESLint? … No / Yes
✔ Would you like to use Tailwind CSS? … No / Yes
✔ Would you like to use `src/` directory? … No / Yes
✔ Would you like to use App Router? (recommended) … No / Yes
✔ Would you like to customize the default import alias (@/*)? … No / Yes
cd module-resolution-test
npm install --save-dev @graphprotocol/client-cli
touch .graphclientrc.yml
npx graphclient build
- Dominant language
- TypeScript
- Stars
- 186
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from graphprotocol/graph-client
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
graphprotocol/graph-client#1029 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
graphprotocol/graph-client#1031 · 4 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
graphprotocol/graph-client#1001 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 50/100
graphprotocol/graph-client#991 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 28/100
graphprotocol/graph-client#957 ·
All issues in graphprotocol/graph-client
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
bcgov/bc-wallet-mobile#4761 · 1 comment ·
-
external-issue to-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
refactor
Difficulty 2/5 1-3 hours Newbie friendliness 84/100