fix: Triggering a loop restart issue when saving the nuxt.config.ts file#1050
fix: Triggering a loop restart issue when saving the nuxt.config.ts file#1050
Conversation
Bundle Stats — create-nuxt size comparisonHey 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
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Bundle Stats — nuxi size comparisonHey 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
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — nuxt-cli size comparisonHey 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
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #1050 will not alter performanceComparing Summary
|
|
thank you for the PR & investigation 🙏 |
🔗 Linked issue
refer:
nuxt/bridge#1591
nuxt/bridge#1623
❓ Type of 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.



