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

Top level TypeScriptLoader(ts-node) registration issue #8588

Closed
Diizzayy opened this issue Nov 8, 2022 · 1 comment
Closed

Top level TypeScriptLoader(ts-node) registration issue #8588

Diizzayy opened this issue Nov 8, 2022 · 1 comment
Labels
stage/4-pull-request A pull request has been opened that aims to solve the issue

Comments

@Diizzayy
Copy link
Contributor

Diizzayy commented Nov 8, 2022

Which packages are impacted by your issue?

@graphql-codegen/cli

Describe the bug

The change introduced here by #8452 results in the unnecessarily early registration of ts-node which subsequently attempts to load a project's tsconfig.json if present.

This isn't an issue for most projects, because the tsconfig tends to be static and independent.

However though, with Nuxt 3 we've taken the approach of immensely improving upon the developer experience by providing auto imports among with other typescript first conventions to make the workflow as seamless as possible.

Nuxt 3 projects contain a root tsconfig.json file which extends from an auto generated tsconfig located at .nuxt/tsconfig.json, hence the issue explained above. This has resulted in Nuxt graphql modules which leverage the amazing graphql code generator developed here to crash whenever that .nuxt/tsconfig.json hasn't been previously generated.

Steps to Reproduce the Bug or Issue

  1. Clone nuxt-graphql-client
  2. Run pnpm i to install dependencies
  3. Run pnpm prepare to successfully prepare the app

Trigger Issue

  1. Delete the playground/.nuxt/tsconfig.json file
  2. Open package.json and removed the patched dependency from line 70
  3. Run pnpm i to apply changes
  4. Run pnpm prepare to see issue

Expected behavior

Should run properly without the prerequisites of the project's tsconfig.json file being present.

Screenshots or Videos

No response

Platform

  • OS: macOS
  • NodeJS: v18.11.0
  • graphql version: 16.6.0
  • @graphql-codegen/cli version(s): 2.13.11

Codegen Config File

No response

Additional context

No response

@Diizzayy Diizzayy changed the title Top level TypeScriptLoader registration(ts-node) issue Top level TypeScriptLoader(ts-node) registration issue Nov 8, 2022
@charlypoly charlypoly added the stage/4-pull-request A pull request has been opened that aims to solve the issue label Nov 30, 2022
@charlypoly
Copy link
Contributor

@Diizzayy, thanks for the fix!
It has been released in @graphql-codegen/cli@2.15.0 📦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/4-pull-request A pull request has been opened that aims to solve the issue
Projects
None yet
Development

No branches or pull requests

2 participants