Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

TS5095 error when building

Open
#357 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
graphql, typescript
Domain
api, build-system

Research direction

Reproduce the failure with the linked Vue 3/Apollo 3 example by running graphclient build; start by comparing its TypeScript configuration with the working React example. Trace schema generation for the compoundv2 and uniswapv2 handlers, and consider the issue resolved when both schemas generate without TS5095.

Written by the indexing model from the issue text.

Description

I'm getting this error when I build my local graphclient package:

Failed to generate the schema Error: Failed to fetch introspection from https://api.thegraph.com/subgraphs/name/graphprotocol/compound-v2: error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.

What am I missing in my Vue 3 / Apollo 3 / TypeScript implementation? The react example with the same graph client config and example query compiles just fine so that leads me to believe it might be a tsconfig misconfiguration, but I can't seem to nail it down. Any help would be much appreciated, thank you!


My repository: https://github.com/datanexus-vincent/graph-client-vue3-apollo-example

Full debug log:

yarn run v1.22.15
$ graphclient build
💡 GraphClient Cleaning existing artifacts
💡 GraphClient Reading the configuration
@graphql-tools/load: normalizePointers ./src/queries/example-query.graphql: 0.077ms
@graphql-tools/load: normalizePointers: 0.228ms
@graphql-tools/load: collectDocumentString ./src/queries/example-query.graphql: 0.064ms
@graphql-tools/load: collectSources ./src/queries/example-query.graphql: 0.326ms
@graphql-tools/load: loadFile ./src/queries/example-query.graphql: 10.006ms
@graphql-tools/load: collectFallback ./src/queries/example-query.graphql: 10.225ms
@graphql-tools/load: collectSources queue: 34.474ms
@graphql-tools/load: parseSchema /home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/src/queries/example-query.graphql: 0.014ms
@graphql-tools/load: parseRawSDL /home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/src/queries/example-query.graphql: 0.057ms
@graphql-tools/load: useComments /home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/src/queries/example-query.graphql: 1.309ms
@graphql-tools/load: collectValidSources /home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/src/queries/example-query.graphql: 0.016ms
@graphql-tools/load: parseSource /home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/src/queries/example-query.graphql: 2.087ms
@graphql-tools/load: prepareResult: 0.005ms
@graphql-tools/load: loadTypedefs: 38.218ms
💡 GraphClient Generating the unified schema
🐛 GraphClient - GetMesh Getting subschemas from source handlers
🐛 GraphClient - uniswapv2 Generating the schema
🐛 GraphClient - compoundv2 Generating the schema
💥 GraphClient - compoundv2 Failed to generate the schema Error: Failed to fetch introspection from https://api.thegraph.com/subgraphs/name/graphprotocol/compound-v2: error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.

    at GraphQLHandler.getMeshSource (/home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/node_modules/@graphql-mesh/graphql/cjs/index.js:302:23)
    at async /home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:132:28
💥 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 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.

    at GraphQLHandler.getMeshSource (/home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/node_modules/@graphql-mesh/graphql/cjs/index.js:302:23)
    at async /home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:132:28
💥 GraphClient Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh.
    at getMesh (/home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:166:15)
    at async Object.handler (/home/vincenttaglia/WebstormProjects/graph-client-vue3-apollo-example/node_modules/@graphql-mesh/cli/cjs/index.js:304:53)
error Command failed with exit code 1.
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from graphprotocol/graph-client

All issues in graphprotocol/graph-client

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.