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

Rebuild loop when running nuxi dev #832

Closed
dwightjack opened this issue Jun 26, 2023 · 12 comments
Closed

Rebuild loop when running nuxi dev #832

dwightjack opened this issue Jun 26, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@dwightjack
Copy link
Contributor

Environment


  • Operating System: Darwin
  • Node Version: v18.16.0
  • Nuxt Version: 2.17.0
  • Nitro Version: 2.4.1
  • Package Manager: pnpm@8.5.0
  • Builder: webpack
  • User Config: head, components, build, serverHandlers, devServerHandlers, devServer, typescript, nitro, bridge, buildModules
  • Runtime Modules: -
  • Build Modules: (), @nuxt/bridge@3.0.0-28109745.a6e6787

Reproduction

Describe the bug

On a fresh install of Nuxt and Nuxt Bridge, I often experience rebuild loops in development mode.

Sometimes the error is Cannot read properties of null (reading 'close'), more often the message is .nuxt/dist directory has been removed. Restarting nuxt.... I attach a sample video of what's happening:

nuxt-bridge.mp4

Additional context

No response

Logs

● Client █████████████████████████ building (64%) 450/455 modules 5 active
 node_modules/.pnpm/@babel+runtime@7.22.5/node_modules/@babel/runtime/helpers/esm/superPropBase.js

✔ Server
  Compiled successfully in 2.61s
ℹ .nuxt/dist directory has been removed. Restarting nuxt...                                                                           12:42:43 PM

 FATAL  Cannot read properties of null (reading 'close')
@wattanx
Copy link
Collaborator

wattanx commented Jun 26, 2023

The version of bridge appears to be out of date.
Does this still occur with the latest version?
"@nuxt/bridge": "npm:@nuxt/bridge-edge@3.0.0-28125529.9b0a98e"

@dwightjack
Copy link
Contributor Author

@wattanx Thanks for the reply. I updated the version, removed the lock file, and reinstalled it, but the issue is still there.

Here is another reproduction video (I also updated the reproduction repo)

nuxt-bridge-2.mp4

@dwightjack
Copy link
Contributor Author

@wattanx An update. I tried to run the same repo on a M1 Macbook with more RAM and the issue is happening less often. The only thing that changes seems to be that on the M1 the task completes faster.

@ColinRosati
Copy link

I can reproduce this

@wattanx
Copy link
Collaborator

wattanx commented Jun 27, 2023

Thanks for the report!!
I will investigate this in more detail. (Not a sure thing to occur.)

https://stackblitz.com/edit/github-3fgb91-mgegmc

✔ Builder initialized                                                                23:29:23
ℹ .nuxt/dist directory has been removed. Restarting nuxt...                           23:29:24

 FATAL  Cannot read properties of null (reading 'close')                              23:29:24

  at Builder.unwatch (node_modules/@nuxt/builder/dist/builder.js:713:30)
  at Builder.close (node_modules/@nuxt/builder/dist/builder.js:721:10)
  at eval (node_modules/@nuxt/builder/dist/builder.js:179:42)
  at eval (node_modules/hable/dist/hable.js:1:1065)
  at eval (node_modules/hable/dist/hable.js:1:283)
  at async Nuxt.callHook (node_modules/hable/dist/hable.js:1:1034)
  at async Nuxt.close (node_modules/@nuxt/core/dist/core.js:359:5)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:192:11)
  at async _applyPromised (node_modules/nuxi/dist/chunks/dev.mjs:111:10)

@bradley-varol
Copy link

Seeing exactly the same issue and same .nuxt/dist directory has been removed. Restarting nuxt... message

@wattanx
Copy link
Collaborator

wattanx commented Aug 12, 2023

📝

Setting build.quiet: true made the logs easier to read.

Nuxi 3.6.5                                                                            17:57:12
Nuxt 2.17.1 with Nitro 2.5.2                                                          17:57:12
                                                                                      17:57:12
  > Local:    http://localhost:3000/ 
  > Network:  http://192.168.1.104:3000/

ℹ Module meta took 1.5ms to setup.                                                   17:57:13
ℹ Module nuxt-bridge took 5.68ms to setup.                                           17:57:13
ℹ Module imports took 0.44ms to setup.                                               17:57:13
ℹ .nuxt/dist directory has been removed. Restarting nuxt...                          17:57:132

 FATAL  Cannot read properties of null (reading 'close')                              17:57:13

  at Builder.unwatch (node_modules/@nuxt/builder/dist/builder.js:713:30)
  at Builder.close (node_modules/@nuxt/builder/dist/builder.js:721:10)
  at eval (node_modules/@nuxt/builder/dist/builder.js:179:42)
  at eval (node_modules/hable/dist/hable.js:1:1065)
  at eval (node_modules/hable/dist/hable.js:1:283)
  at async Nuxt.callHook (node_modules/hable/dist/hable.js:1:1034)
  at async Nuxt.close (node_modules/@nuxt/core/dist/core.js:359:5)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:193:11)
  at async _applyPromised (node_modules/nuxi/dist/chunks/dev.mjs:112:10)

ℹ Module meta took 0.26ms to setup.                                                  17:57:13
ℹ Module nuxt-bridge took 0.86ms to setup.                                           17:57:13
ℹ Module imports took 0.26ms to setup.                                               17:57:13
✔ Nitro built in 261 ms                                                        nitro 17:57:16
Nuxi 3.6.5                                                                            17:57:16
                                                                                      17:57:16
  > Local:    http://localhost:3000/ 
  > Network:  http://192.168.1.104:3000/


@wattanx
Copy link
Collaborator

wattanx commented Aug 14, 2023

I confirmed that the latest nuxi solved the problem. (nuxi-edge@3.7.0-28199397.4e409614)
https://stackblitz.com/edit/github-3fgb91-c32oex

This will be resolved when Nuxt 3.7.0 is released!

@wattanx wattanx added bug Something isn't working and removed pending triage labels Aug 14, 2023
@Rosendito
Copy link

@wattanx I love u, u have saved my life!!

@jeanpierrecarvalho
Copy link
Contributor

@wattanx awesome!

@wattanx
Copy link
Collaborator

wattanx commented Sep 9, 2023

Resolved with version 3.0.0-28232126.5c5bc70.

@wattanx wattanx closed this as completed Sep 9, 2023
@wJoenn
Copy link

wJoenn commented Jan 1, 2024

@wattanx I'm having the same issue while running

  • Nuxt 2.17.2
  • Bridge 3.0.0-rc.4-28381778.ba2b18e
  • Nuxi 3.10.0

My dev server keeps recompiling/rebuilding infinitely
Should I open a new issue ?
image

EDIT:
Nevermind, the issue was that my nuxt.config.ts file was in my tailwind.config 's content array
Removing it as suggested in this comment solved the issue for me #29 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants