question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When `nuxt-graphql-client` is defined in `modules`, it throws a TS error on npm run dev when `.nuxt` is removed

See original GitHub issue

When you remove the .nuxt folder (e.g. with npx nuxi clean) and try to start dev mode, this plugin crashes because it’s trying to run TS before the .nuxt folder is generated.

It looks like this module is running some typescript compilation before the .nuxt folder is generated, and since tsconfig.json depends on a config file in .nuxt, it will fail to run at all:

  error TS5083: Cannot read file '.nuxt/tsconfig.json'.

  at createTSError (node_modules/ts-node/src/index.ts:859:12)
  at reportTSError (node_modules/ts-node/src/index.ts:863:19)
  at createFromPreloadedConfig (node_modules/ts-node/src/index.ts:874:36)
  at create (node_modules/ts-node/src/index.ts:624:10)
  at register (node_modules/ts-node/src/index.ts:591:15)
  at TypeScriptLoader (node_modules/cosmiconfig-typescript-loader/dist/cjs/index.js:52:54)
  at node_modules/@graphql-codegen/cli/esm/config.js:16:18
  at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
  at async Promise.all (index 0)
  at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
  at async normalizeModule (node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:476:26)
  at async installModule (node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:455:41)
  at async initNuxt (node_modules/nuxt/dist/index.mjs:1606:7)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:6778:9)
  at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6828:5)
  at async _main (node_modules/nuxi/dist/cli.mjs:50:20)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
Diizzayycommented, Oct 14, 2022

@TheDutchCoder @p3t3r67x0 This issue was caused by upstream changes to the @graphql-codegen/cli package. Version.

I’ve just released v0.1.23 for this module which resolves the aforementioned dependency to the last working version as a temporary fix for this issue.

2reactions
Diizzayycommented, Oct 11, 2022

@p3t3r67x0 Thank you for the reproduction details ( it worked ) , I’ll investigate further into it and update this issue accordingly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot start nuxt: Cannot find module 'nuxt' #3060 - GitHub
npm install npm run dev. Nuxt CLI v3.0.0-27398533.8edd481 > Local: http://localhost:3000/ ERROR Cannot start nuxt: Cannot find module 'nuxt' Require stack: ...
Read more >
Error in running nuxt project: "'nuxt' is not recognized as an ...
I solved this problem. I was looking in stackoverflow for similar problems and apparently the problem was the npm cache.
Read more >
Commands and Deployment - Nuxt
Commands and deployment. Nuxt comes with a set of useful commands, both for development and production purpose. Using in package.json.
Read more >
Creating Server-side Rendered Vue.js Apps Using Nuxt.js
cd my-nuxt-project npm install # Or yarn npm run dev. There we go. Open your browser to localhost:3000 and your project should be...
Read more >
Quickstart: Nuxt 3 - Supabase
Learn how to use Supabase in your Nuxt 3 App. ... Before we start building we're going to set up our Database and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found