Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh SDK TypeScript usage requires skipLibCheck: true - else throws TS1254 in upstream dependency cross-undici-fetch #3711

Closed
JustusNBB opened this issue Mar 16, 2022 · 4 comments

Comments

@JustusNBB
Copy link
Contributor

Describe the bug

node_modules/cross-undici-fetch/dist/index.d.ts (12,23)
 TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

To Reproduce
Steps to reproduce the behavior:
The issue has already been reported in the upstream repo six weeks ago: ardatan/whatwg-node#18

Expected behavior

No type errors when tsc-(re)compiling SDK client packages into modules.

Environment:

  • OS: Windows/WSL Ubuntu
  • NodeJS: 12/14
  "dependencies": {
    "@graphql-mesh/cache-inmemory-lru": "^0.6.1",
    "@graphql-mesh/merger-stitching": "^0.15.23",
    "@graphql-mesh/openapi": "0.23.26-alpha-05bde4ba4.0",
    "@graphql-mesh/runtime": "^0.32.0",
    "@graphql-tools/utils": "^8.6.1",
    "graphql": "^15.5.0",
    "graphql-jit": "^0.7.3",
    "graphql-tag": "^2.12.6",
    "tslib": "^2.3.1"
  },
  "resolutions": {
    "@graphql-mesh/utils": "0.30.1"
  },
  "devDependencies": {
    "@graphql-mesh/cli": "^0.62.1",

Additional context

My dependency update is currently still unstable.
I also have this new globalContext argument addition to work around (it's not even used...), please explain!

//.mesh/index.ts [
export async function getMeshSDK<TGlobalContext = any, TOperationContext = any>(globalContext: TGlobalContext) {
@JustusNBB
Copy link
Contributor Author

@ardatan I can help a bit with tests the next couple of days so we can hopefully get a stable release again soon!

@JustusNBB JustusNBB changed the title Mesh SDK TypeScript usage throws TS1254 in upstream dependency cross-undici-fetch Mesh SDK TypeScript usage requires skipLibCheck: true - else throws TS1254 in upstream dependency cross-undici-fetch Mar 17, 2022
@JustusNBB
Copy link
Contributor Author

JustusNBB commented Mar 21, 2022

Tried another update today, but now the project is even more unstable :|

  "dependencies": {
    "@graphql-mesh/cache-inmemory-lru": "^0.6.3", // bumped again
    "@graphql-mesh/merger-stitching": "^0.15.27",
    "@graphql-mesh/openapi": "^0.24.0", // bumped again
    "@graphql-mesh/runtime": "^0.33.3", // bumped again
    "@graphql-tools/utils": "^8.6.3",
    "graphql": "^15.5.0",
    "graphql-jit": "^0.7.3",
    "graphql-tag": "^2.12.6",
    "tslib": "^2.3.1"
  },
  // removed utils resolution
  "devDependencies": {
    "@graphql-mesh/cli": "^0.63.0", // bumped again

mesh dev still seems to work, but the new GraphiQL server doesn't include the example queries.
For my apollo server, I tried to use context: ({ req }) => req, as a replacement, but that throws TypeError: Cannot read property 'Query' of undefined.

I will create more tickets as needed for these seperate issues, but here I just want to find a stable version set, so I can pin and release.
(This was now the fourth time unsuccessfully bumping dependencies)

Can you please give me an update what has been recently going on, or where I can find information to properly migrate - I might have missed?

Also I am still getting the type error from the cross-undici-fetch dependency. Please notify/close if this is no longer supposed to be the case.

@JustusNBB
Copy link
Contributor Author

For my apollo server, I tried to use context: ({ req }) => req, as a replacement, but that throws TypeError: Cannot read property 'Query' of undefined.

Found a fix for this, it is actually just context: meshContext (previously context: contextBuilder)

@Urigo Urigo mentioned this issue Aug 11, 2022
22 tasks
@ardatan
Copy link
Owner

ardatan commented Mar 31, 2023

We no longer use cross-undici-fetch so the issue might not be relevant.
Closing this issue for now. Let us know if this still doesn't work properly so we can reopen the issue.

@ardatan ardatan closed this as completed Mar 31, 2023
This was referenced Apr 30, 2024
This was referenced May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants