Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Error: Option 'bundler' can only be used when 'module' is set to 'es2015' or later.

Aperta
#619 0 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
graphql, next.js, typescript
Ambito
api, tooling

Direzione di ricerca

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".

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
185
Fork
49
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di graphprotocol/graph-client

Tutte le issue di graphprotocol/graph-client

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.