-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix(kit): avoid mutating cached ESM config in layer resolution #33779
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
Conversation
|
|
WalkthroughThe change modifies the layer configuration handling in the loader config module to prevent mutation of cached layer configuration objects. It introduces a resolved root directory value that defaults to the layer config's existing rootDir or falls back to layer.cwd. The layer configuration is then rewritten as a shallow copy with the resolved rootDir applied. Additionally, the processed-layers tracking mechanism is updated to use this resolved rootDir value instead of the original layer.config.rootDir, which prevents duplicate processing when rootDir was previously undefined. Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx,vue}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx,js,jsx,vue}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (1)📚 Learning: 2024-11-05T15:22:54.759ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@nuxt/kit
@nuxt/nitro-server
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
CodSpeed Performance ReportMerging #33779 will not alter performanceComparing Summary
|
🔗 Linked issue
Resolves: #33733
📚 Description
Fixes
.outputbeing created in layer subdirectory instead of project root when layers use ESM configs (.mjs,.jswith "type": "module", or fromnode_modules).The bug occurred because
layer.config.rootDir ??= layer.cwd!directly mutated the cached ESM module object. On subsequent builds, the cached object already hadrootDirset to the layer's directory.Fix: Create a shallow copy via spread operator instead of mutating the original.