TS5095 error when building
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
- 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
-
blocklist removal
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
pastelsky/bundlephobia#1122 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100