nuxt / nuxt/bridge

Server failed when reloading `nuxt.config.js` with Bridge Vite

Open
#47 1 comment 3 reactions 1 assignee View on GitHub

@antfu is already working on this.

Since Nov 16, 2021.

bug vite
Dominant language
TypeScript
Stars
285
Forks
33
Avg merge
22h 38m
Merged PRs (30d)
3

Description

Environment

  • Operating System: Darwin
  • Node Version: v16.11.1
  • Nuxt Version: 2.16.0-27282256.ab1c6cb4
  • Package Manager: pnpm@6.21.1
  • Bundler: Webpack
  • User Config: buildModules, css, target, components, bridge, unocss
  • Runtime Modules: -
  • Build Modules: @unocss/nuxt@0.9.3, @vueuse/core/nuxt@6.9.0, @nuxt/bridge-edge@3.0.0-27283244.4a3ba73

Reproduction

(Essential every Bridge app with Vite)

https://github.com/antfu/vitesse-nuxt-bridge
https://github.com/nuxt/modules

Describe the bug

Everything work until we modify the nuxt.config.js and triggers this error:

 FATAL  Template not found: /Users/antfu/i/vitesse-nuxt-bridge/.nuxt/middleware.js                10:01:04

  at normalizeTemplate (node_modules/.pnpm/@nuxt+kit-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/kit-edge/dist/index.mjs:924:13)
  at addTemplate (node_modules/.pnpm/@nuxt+kit-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/kit-edge/dist/index.mjs:908:20)
  at addPluginTemplate (node_modules/.pnpm/@nuxt+kit-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/kit-edge/dist/index.mjs:973:16)
  at setup (node_modules/.pnpm/@nuxt+bridge-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/bridge-edge/dist/chunks/module2.mjs:152:5)
  at Object.wrappedModule (node_modules/.pnpm/@nuxt+kit-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/kit-edge/dist/index.mjs:1212:22)
  at installModule (node_modules/.pnpm/@nuxt+kit-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/kit-edge/dist/index.mjs:1261:17)
  at setup (node_modules/.pnpm/@nuxt+bridge-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/bridge-edge/dist/chunks/module.mjs:993:13)
  at async ModuleContainer.addModule (node_modules/.pnpm/@nuxt+core-edge@2.16.0-27282256.ab1c6cb4/node_modules/@nuxt/core-edge/dist/core.js:174:20)
  at async ModuleContainer.ready (node_modules/.pnpm/@nuxt+core-edge@2.16.0-27282256.ab1c6cb4/node_modules/@nuxt/core-edge/dist/core.js:45:7)
  at async Nuxt._init (node_modules/.pnpm/@nuxt+core-edge@2.16.0-27282256.ab1c6cb4/node_modules/@nuxt/core-edge/dist/core.js:346:5)


 ERROR  Cannot restart nuxt:  Template not found: /Users/antfu/i/vitesse-nuxt-bridge/.nuxt/middleware.js

  at normalizeTemplate (node_modules/.pnpm/@nuxt+kit-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/kit-edge/dist/index.mjs:924:13)
  at addTemplate (node_modules/.pnpm/@nuxt+kit-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/kit-edge/dist/index.mjs:908:20)
  at addPluginTemplate (node_modules/.pnpm/@nuxt+kit-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/kit-edge/dist/index.mjs:973:16)
  at setup (node_modules/.pnpm/@nuxt+bridge-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/bridge-edge/dist/chunks/module2.mjs:152:5)
  at Object.wrappedModule (node_modules/.pnpm/@nuxt+kit-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/kit-edge/dist/index.mjs:1212:22)
  at installModule (node_modules/.pnpm/@nuxt+kit-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/kit-edge/dist/index.mjs:1261:17)
  at setup (node_modules/.pnpm/@nuxt+bridge-edge@3.0.0-27283244.4a3ba73/node_modules/@nuxt/bridge-edge/dist/chunks/module.mjs:993:13)
  at async ModuleContainer.addModule (node_modules/.pnpm/@nuxt+core-edge@2.16.0-27282256.ab1c6cb4/node_modules/@nuxt/core-edge/dist/core.js:174:20)
  at async ModuleContainer.ready (node_modules/.pnpm/@nuxt+core-edge@2.16.0-27282256.ab1c6cb4/node_modules/@nuxt/core-edge/dist/core.js:45:7)
  at async Nuxt._init (node_modules/.pnpm/@nuxt+core-edge@2.16.0-27282256.ab1c6cb4/node_modules/@nuxt/core-edge/dist/core.js:346:5)


 ERROR  [unhandledRejection] ENOENT: no such file or directory, open '/Users/antfu/i/vitesse-nuxt-bridge/.nuxt/dist/server/client.manifest.json'
Additional context

No response

Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.