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

build fails: Unknown file extension ".ts"

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
graphql, typescript
Ambito
build-system, cli

Direzione di ricerca

Start with the graphclient build path that handles the --fileType ts option and compare it with the default generation path that fails while loading .graphclient/sources/uniswapv2/introspectionSchema.ts. Reproduce the failure in a fresh Astro project with TypeScript enabled, then verify that npx graphclient build succeeds without the workaround.

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

Descrizione

Problem

Similarly to #409, I was just following the tutorial from https://thegraph.com/docs/en/querying/querying-from-an-application/ and it failed at the code generation step.

➜ npx graphclient build
(node:9415) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
💡 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: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/daniel/repos/my-project/my-project-ui/.graphclient/sources/uniswapv2/introspectionSchema.ts
    at new NodeError (node:internal/errors:371:5)
    at Object.file: (node:internal/modules/esm/get_format:72:15)
    at defaultGetFormat (node:internal/modules/esm/get_format:85:38)
    at defaultLoad (node:internal/modules/esm/load:13:42)
    at ESMLoader.load (node:internal/modules/esm/loader:303:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:230:58)
    at new ModuleJob (node:internal/modules/esm/module_job:63:26)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:244:11)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:281:24) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
    at GraphQLHandler.getMeshSource (/home/daniel/repos/my-project/my-project-ui/node_modules/@graphql-mesh/graphql/cjs/index.js:339:23)
    at async /home/daniel/repos/my-project/my-project-ui/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:128:28
💥 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 (/home/daniel/repos/my-project/my-project-ui/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:162:15)
    at async Object.handler (/home/daniel/repos/my-project/my-project-ui/node_modules/@graphql-mesh/cli/cjs/index.js:311:53)

The code is a fresh astro project created with npm create astro@latest and with Typescript enabled.

Fixes
  1. I tried adding ts-node as suggested by this tutorial I've look into https://graphql.wtf/episodes/45-the-graph-client. Did not work.
  2. I tried using a different tsconfig.json. Did not work.

What works is calling npx graphclient build --fileType ts as seen in this tutorial: https://www.youtube.com/watch?v=Wsq2fopq4BQ.

Lingua principale
TypeScript
Stelle
186
Fork
49
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. 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.