nuxt / fonts

Plug-and-play web font optimization and configuration for Nuxt apps.
https://nuxt.com
MIT License
370 stars 4 forks source link

Cannot start nuxt: Failed to get devtools context. #149

Open larrasu opened 2 weeks ago

larrasu commented 2 weeks ago

Environment

Version

v0.7.0

Reproduction

https://stackblitz.com/~/github.com/larrasu/frontend-mentor

cd solutions/invoice-app
pnpm dev

Description

I've been experiencing this error in various projects. I'm not sure why I can't reproduce the error on Stackblitz. It's the same repo and branch. The error is still showing up on my end as of now. The only way to get rid of this error is by removing @nuxt/fonts from the nuxt.config.ts. So I figured there is a conflict between@nuxt/fonts and @nuxt/devtools?

Logs

 ERROR  Cannot start nuxt:  Failed to get devtools context.                         12:09:04 AM

  at extendServerRpc (node_modules/.pnpm/@nuxt+devtools-kit@1.2.0_nuxt@3.11.2_vite@5.2.11/node_modules/@nuxt/devtools-kit/dist/index.mjs:96:11)
  at node_modules/.pnpm/@nuxt+fonts@0.7.0_nuxt@3.11.2_vite@5.2.11/node_modules/@nuxt/fonts/dist/module.mjs:1137:11
  at node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs:48:66
  at Object.run (node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs:41:43)
  at node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs:48:56
  at async enableModule (/Users/larrasu/.nvm/versions/node/v16.15.1/lib/node_modules/@nuxt/devtools/dist/chunks/module-main.mjs:8466:3)
  at async normalizedModule (/Users/larrasu/.nvm/versions/node/v16.15.1/lib/node_modules/@nuxt/devtools/node_modules/@nuxt/kit/dist/index.mjs:169:17)
  at async installModule (node_modules/.pnpm/@nuxt+kit@3.11.2/node_modules/@nuxt/kit/dist/index.mjs:2415:95)
  at async initNuxt (node_modules/.pnpm/nuxt@3.11.2_@opentelemetry+api@1.8.0_@unocss+reset@0.59.4_drizzle-orm@0.30.10_eslint@9.2.0_fl_br3acc34oknouixgtiqiyrhd6y/node_modules/nuxt/dist/index.mjs:4233:7)
  at async NuxtDevServer._load (node_modules/.pnpm/nuxi@3.11.1/node_modules/nuxi/dist/chunks/dev2.mjs:6879:5)
dosubot[bot] commented 2 weeks ago

The error you're encountering with @nuxt/fonts and @nuxt/devtools seems to be related to the extendServerRpc function, which facilitates communication between the Nuxt development tools UI and the server. This issue might be similar to a previously reported problem that was resolved in a past version of @nuxt/fonts.

To address this, first, ensure you're using the latest versions of both @nuxt/fonts and @nuxt/devtools. If updating does not resolve the issue, consider reviewing your .nuxtrc file for any incorrect module references that could be causing a conflict.

It's also worth noting that changes in @nuxt/fonts version 0.7.0 do not explicitly mention modifications that would conflict with @nuxt/devtools, suggesting that the issue might be more nuanced, possibly involving specific configurations or steps in your development process.

If the problem persists after these checks, providing more detailed information about your configuration and the steps leading to the error could help identify other potential causes.

#### Details **Sources** - [Nuxt DevTools error](https://github.com/nuxt/fonts/issues/52) - [.nuxtrc](https://github.com/nuxt/fonts/blob/main/.nuxtrc) - [CHANGELOG.md](https://github.com/nuxt/fonts/blob/main/CHANGELOG.md) - [src/devtools.ts](https://github.com/nuxt/fonts/blob/main/src/devtools.ts) - [playground/nuxt.config.ts](https://github.com/nuxt/fonts/blob/main/playground/nuxt.config.ts)
**About Dosu** This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.