-
Notifications
You must be signed in to change notification settings - Fork 64
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
[3.8.0] ERROR Cannot start nuxt: kit.writeTypes is not a function #157
Comments
@imcm7 You can remove these resolutions if you are using a recent version of Nuxt. In the meantime you should be able to make it work by downgrading to nuxt 3.7.0. |
Related Hebilicious/authjs-nuxt#90 |
I also get the same error when updating to Same error for 3.7.0. Here is my config.
|
Can anyone make a runnable reproduction? 🙏 it would help a lot to quickly deliver a hotfix. |
I have a WIP project that has the issue https://github.com/PalmerEk/qvhs-programs/tree/main I tried reverting nuxt back to 3.7.0 to no avail. npx nuxi dev = ERROR Cannot start nuxt: kit.writeTypes is not a function npx nuxi@3.7.3 dev = works |
I have same issue in upgrading from 3.6.5 to 3.7.1 (also occurs on 3.7.0), can't build the project with The issue for me seems to be on account of missing items from In the failing project, that index.d.ts file doesn't have any reference to a I replicated the error in my failing project in both GitBash and PowerShell after running the typical removal of package-lock, node_modules, and doing a force clean of npm's cache. I'm trying yarn and pnpm now to see if I can get either of those to pull down the @nuxt/kit with the correct def for writeTypes function. Also, separately, I had issue installing with the standard npx nuxi command in GitBash (separate issue with the CLI) but it did work in PowerShell. |
@PalmerEk I was able to run your program by cloning, deleting the lockfile and running |
Thanks for all the updates and context. Let's hope it is a lockfile issue, yet it is unacceptable behavior from CLI for me. I will spend some time to investigate this better. |
npx nuxi cleanup && rm -rf ./node_modules/ && rm package-lock.json && npm i && npm run dev: Error Tried clearing npm cache as well, no dice |
Unable to reproduce this 😢 Does the error show up for you in the console immediately after you run |
I get the same error with a brand new vanilla Nuxt install on MacOS Ventura 13.5.2, node 18.16.0, and npm 9.5.1. See steps below. [BEGIN] *** STEP 1 *** npx nuxi@latest init my-project-here ✔ Which package manager would you like to use?
✔ Types generated in .nuxt added 849 packages, and audited 851 packages in 42s 143 packages are looking for funding found 0 vulnerabilities ✨ Nuxt project has been created with the v3 template. Next steps: *** STEP 2 *** cd my-project-here
Nuxt 3.7.1 with Nitro 2.6.3 ➜ Local: http://localhost:3000/ ✔ Nuxt DevTools is enabled v0.8.3 (experimental) ERROR Cannot start nuxt: kit.writeTypes is not a function at NuxtDevServer._load (node_modules/nuxi/dist/chunks/dev.mjs:230:11) [END] Please advise as I have to get a new project up and delivered to a colleague to start working on tomorrow; am blocked until then. Thanks, all. UPDATE My other working Nuxt apps are on 3.6.5, so I tried this: [BEGIN AGAIN] *** STEP 1 *** npx nuxi@3.6.5 init my-project-here Need to install the following packages: *** STEP 2 *** cd my-project-here
✔ Types generated in .nuxt added 849 packages, and audited 851 packages in 48s 143 packages are looking for funding found 0 vulnerabilities *** STEP 3 *** npm run dev
Nuxt 3.7.1 with Nitro 2.6.3 ➜ Local: http://localhost:3000/ ✔ Nuxt DevTools is enabled v0.8.3 (experimental) ERROR Cannot start nuxt: kit.writeTypes is not a function at NuxtDevServer._load (node_modules/nuxi/dist/chunks/dev.mjs:230:11) [END] The only thing I can think of that's different is this "v3 template" it refers to. I don't remember seeing that when I did my 3.6.5 installs before, but I could be mistaken. |
@PalmerEk @reneonguitar Might be a shot in the dark, but some users have reported that updating node to v20+ worked for them 🤷🏽 |
Sadly, this doesn't work for me either. Behold... Same Nuxt steps as before... |
I feel your frustration, the best way to get this sorted would be to provide a reproduction... which seems hard as it doesn't seems to happen on every device. I assume that if you use stackblitz/codesanbox, everything works fine, so that is something happening on your end... The only thing I can think of would be deleteting lockfiles, caches, node_modules, parent node_modules, and using bun. |
Indeed, stackblitz shows node 16.20.0 and npm 9.4.2 while codesandbox shows node 16.17.0 and npm and 8.15.0 in their working sandboxes of Nuxt 3. I moved up from node 16 to 18 recently because of AWS Lambda's upcoming deprecation of 16, but I may need to use split versions between frontend Nuxt and backend Lambdas if I can get 16 to work with Nuxt to get over my immediate hurdle. I'm not surprised by these things anymore... |
Sorry for all the inconvenience this might have caused to you. The regression was about CLI compatibility with Nuxt < 3.7 which will be solved soon (#158) |
@justin-schroeder checking your reproduction, it seems outdated nuxt causes other issues. I recommend running at least (same for others if still facing any issues and your repo is public) |
Great, I see the issue is closed. How does one try it out? Thanks. |
@pi0 nevermind my question about trying it out. i see it was as simple as recreating a new project: And I can confirm npm run dev now works. Thanks for all the help and the quick fix. |
Environment
Nuxt project info: 8:15:37 AM
Reproduction
New instaled nuxt with modules
Describe the bug
ERROR Cannot start nuxt: kit.writeTypes is not a function 8:14:17 AM
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: