Skip to content

Conversation

@jianxing-xu
Copy link
Contributor

πŸ”— Linked issue

refer:
nuxt/bridge#1591
nuxt/bridge#1623

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I'm migrating my Nuxt2 app to Bridge and I'm running into two issues.

First, I received a response in issue 1591, stating that this issue is caused by versions later than nuxi@3.6.0. So I rolled back to nuxi@3.6.0, which then caused another issue: nuxt/bridge#1623 The app is only reloaded when nuxt.config.js is first saved. I found the answer in the source code: during onReload , the close method is not executed, so the watchConfig method is only executed during the initial startup and init .

Second issue: After using the latest version of Nuxi, I encountered the issue nuxt/bridge#1591. After saving the nuxt.config.js file, the dev server would restart infinitely. I eventually discovered the cause: it was due to the different build environments for Nuxt 2 and Nuxt 3. In Nuxt 2's "kit.buildNuxt" step in the "load" method, Nuxt 2 first cleared the .nuxt directory and then regenerated the artifacts, but Nuxt 3+ didn't do this. As a result, modifications to the dist directory in Nuxt 2 triggered the watcher "this._distWatcher = watch(distDir)", causing the app to restart and then begin a loop. The fix is ​​actually quite simple: simply execute the "close" method before the "_load" method and then re-execute the "watchConfig" method afterward.

Finally, this is a fix specifically for the bridge environment; I don't know if it will make it into the main version of Nuxi.
image
image
image
image

@github-actions
Copy link
Contributor

Bundle Stats β€” create-nuxt size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
7 2.13 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 1.09 kB 0%
chunks/multipart-parser.mjs 5.11 kB 0%
chunks/multipart-parser2.mjs 4.58 kB 0%
chunks/prompt.mjs 42.91 kB 0%
chunks/index.mjs 904.13 kB 0%
chunks/satisfies.mjs 116 B 0%
shared/create-nuxt.DxHW8HtB.mjs 1.19 MB 0%

@github-actions
Copy link
Contributor

Bundle Stats β€” nuxi size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
58 3.61 MB β†’ 3.61 MB (+55 B) +0.00%
Changeset
File Ξ” Size
src/dev/utils.ts πŸ“ˆ +55 B (+0.61%) 8.77 kB β†’ 8.83 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
chunks/index2.mjs 199.51 kB β†’ 199.56 kB (+55 B) +0.03%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 247 B 0%
dev/index.mjs 925 B 0%
chunks/add.mjs 6.89 kB 0%
chunks/analyze.mjs 3.35 kB 0%
chunks/build.mjs 2.04 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/dev-child.mjs 780 B 0%
chunks/dev.mjs 28.45 kB 0%
chunks/devtools.mjs 764 B 0%
chunks/generate.mjs 492 B 0%
chunks/info.mjs 4.43 kB 0%
chunks/init.mjs 675.79 kB 0%
chunks/index.mjs 274 B 0%
chunks/prepare.mjs 1.05 kB 0%
chunks/preview.mjs 3.58 kB 0%
chunks/test.mjs 1.16 kB 0%
chunks/typecheck.mjs 2.06 kB 0%
chunks/upgrade.mjs 6.65 kB 0%
chunks/satisfies.mjs 116 B 0%
chunks/main.mjs 15.3 kB 0%
chunks/prompt.mjs 42.91 kB 0%
chunks/jiti.mjs 498 B 0%
chunks/index3.mjs 71.97 kB 0%
chunks/multipart-parser.mjs 5.11 kB 0%
chunks/add2.mjs 12.1 kB 0%
chunks/search.mjs 45.85 kB 0%
chunks/xdg-open.mjs 25.32 kB 0%
chunks/node.mjs 145.67 kB 0%
chunks/index4.mjs 1.23 kB 0%
chunks/index5.mjs 5.85 kB 0%
chunks/index6.mjs 904.13 kB 0%
chunks/multipart-parser2.mjs 4.58 kB 0%
shared/nuxi.Bv-FePcy.mjs 19.81 kB 0%
shared/nuxi.DQjfoGl0.mjs 57.22 kB 0%
shared/nuxi.CTyTlDmo.mjs 18.91 kB 0%
shared/nuxi.BXGZ9qFF.mjs 792 B 0%
shared/nuxi.C_u-rG9b.mjs 294 B 0%
shared/nuxi.DUZ_WukQ.mjs 2.57 kB 0%
shared/nuxi.8mhVoXwa.mjs 916.43 kB 0%
shared/nuxi.D2_bzAv0.mjs 1.54 kB 0%
shared/nuxi.DQbQuzNE.mjs 4.07 kB 0%
shared/nuxi.BSm0_9Hr.mjs 107 B 0%
shared/nuxi.B5WkReRs.mjs 18.11 kB 0%
shared/nuxi.CJSnaadO.mjs 10.64 kB 0%
shared/nuxi.CrvQqJcE.mjs 836 B 0%
shared/nuxi.BiWTNJI4.mjs 945 B 0%
shared/nuxi.BAGoDD49.mjs 1.05 kB 0%
shared/nuxi.CcH3VZ-h.mjs 158.51 kB 0%
shared/nuxi.BjhZEm2-.mjs 1.75 kB 0%
shared/nuxi.sAj5PmqJ.mjs 128.28 kB 0%
shared/nuxi.QWnQy_ku.mjs 5.75 kB 0%
shared/nuxi.BcK1uW4h.mjs 365 B 0%
shared/nuxi.DU9QXUOf.mjs 26.96 kB 0%
shared/nuxi.D3mADRf9.mjs 14.73 kB 0%
shared/nuxi.BLb4POFS.mjs 42.47 kB 0%
shared/nuxi.Do0aYBCO.mjs 5.46 kB 0%
shared/nuxi.4t9faemh.mjs 43.64 kB 0%

@github-actions
Copy link
Contributor

Bundle Stats β€” nuxt-cli size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
31 97.19 kB β†’ 97.24 kB (+55 B) +0.06%
Changeset
File Ξ” Size
home/runner/work/cli/cli/packages/nuxi/src/dev/utils.ts πŸ“ˆ +55 B (+0.61%) 8.78 kB β†’ 8.83 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
chunks/index.mjs 14.44 kB β†’ 14.49 kB (+55 B) +0.37%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
dev/index.mjs 0 B 0%
index.mjs 236 B 0%
chunks/analyze.mjs 3.35 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/dev-child.mjs 815 B 0%
chunks/dev.mjs 11.31 kB 0%
chunks/devtools.mjs 763 B 0%
chunks/generate.mjs 492 B 0%
chunks/build.mjs 2.04 kB 0%
chunks/index2.mjs 308 B 0%
chunks/add.mjs 11.25 kB 0%
chunks/search.mjs 2.96 kB 0%
chunks/preview.mjs 3.58 kB 0%
chunks/test.mjs 1.16 kB 0%
chunks/typecheck.mjs 2.06 kB 0%
chunks/upgrade.mjs 6.65 kB 0%
chunks/prepare.mjs 1.05 kB 0%
chunks/info.mjs 4.46 kB 0%
chunks/init.mjs 12.18 kB 0%
chunks/add2.mjs 6.89 kB 0%
shared/cli.B9AmABr3.mjs 39 B 0%
shared/cli.Dz2be-Ai.mjs 792 B 0%
shared/cli.BEUGgaW4.mjs 294 B 0%
shared/cli.BSm0_9Hr.mjs 107 B 0%
shared/cli.At9IMXtr.mjs 1.23 kB 0%
shared/cli.pLQ0oPGc.mjs 836 B 0%
shared/cli.qKvs7FJ2.mjs 945 B 0%
shared/cli.Cr-OCgdO.mjs 727 B 0%
shared/cli.DHenkA1C.mjs 351 B 0%
shared/cli.DVoN1ieL.mjs 5.57 kB 0%

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 24, 2025

nuxt-cli-playground

npm i https://pkg.pr.new/create-nuxt@1050
npm i https://pkg.pr.new/nuxi@1050
npm i https://pkg.pr.new/@nuxt/cli@1050

commit: 91beffe

@codecov-commenter
Copy link

Codecov Report

βœ… All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@ada0fad). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1050   +/-   ##
=======================================
  Coverage        ?   27.14%           
=======================================
  Files           ?       76           
  Lines           ?     4005           
  Branches        ?      220           
=======================================
  Hits            ?     1087           
  Misses          ?     2889           
  Partials        ?       29           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 24, 2025

CodSpeed Performance Report

Merging #1050 will not alter performance

Comparing jianxing-xu:fix/loop_restart (91beffe) with main (ada0fad)

Summary

βœ… 2 untouched

@danielroe danielroe merged commit 46d4acf into nuxt:main Sep 24, 2025
15 checks passed
@danielroe
Copy link
Member

thank you for the PR & investigation πŸ™

@github-actions github-actions bot mentioned this pull request Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants