Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxi): ignore buildDir on windows too #3999

Merged
merged 1 commit into from
Mar 31, 2022
Merged

fix(nuxi): ignore buildDir on windows too #3999

merged 1 commit into from
Mar 31, 2022

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Mar 31, 2022

πŸ”— Linked issue

resolves nuxt/bridge#84
resolves nuxt/bridge#75
may resolve some of the issues reported in nuxt/bridge#29, for example nuxt/bridge#29

❓ 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 like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Previously we were checking a string like C:\\test\\.nuxt\\somefile.js against C:\\test\\.nuxt/ which would of course never match, meaning on Windows dev servers were immediately interrupting themselves and restarting when they noticed changes in .nuxt.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added bug Something isn't working cli ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf labels Mar 31, 2022
@danielroe danielroe requested a review from pi0 March 31, 2022 16:01
@danielroe danielroe self-assigned this Mar 31, 2022
@netlify
Copy link

netlify bot commented Mar 31, 2022

βœ… Deploy Preview for nuxt3-docs ready!

Name Link
πŸ”¨ Latest commit 4a6b008
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/6245d05e65f3f200096c62e5
😎 Deploy Preview https://deploy-preview-3999--nuxt3-docs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@pi0 pi0 merged commit e4956c5 into main Mar 31, 2022
@pi0 pi0 deleted the fix/bridge-dev branch March 31, 2022 16:09
@@ -73,7 +73,7 @@ export default defineNuxtCommand({
const watcher = chokidar.watch([rootDir], { ignoreInitial: true, depth: 1 })
watcher.on('all', (event, file) => {
if (!currentNuxt) { return }
if (file.startsWith(withTrailingSlash(currentNuxt.options.buildDir))) { return }
if (normalize(file).startsWith(withTrailingSlash(normalize(currentNuxt.options.buildDir)))) { return }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A note: buildDir should be already normalized (all options from nuxt)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's probably just on Bridge that it is an issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to try normalizing srcDir/buildDir/rootDir for bridge if that's the case. Potentially avoiding more of issues like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn! I had some fun trying figure out where the error originated. For interest sake: my initial thoughts were that the watcher saw changes when /components was written to the build folder and tried to close the watcher at that point to trigger a 'restart'? :D This fix ignores the build path and avoids that, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precisely @Eckhardt-D it wasn't ignoring on windows...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff. Thanks for the fix!

@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working cli ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

windows bridge fails when running dev nuxt-bridge ERROR only on WINDOWS OS - [worker] Cannot find module
3 participants