Repository navigation
fix(kit): do not double-urlify file urls when resolving schema - #32354
Conversation
|
|
WalkthroughThe import of 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (20)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/kit/src/loader/config.ts (1)
11-11: Remove unusedresolveModulePathimport
TheresolveModulePathsymbol is imported but never used in this module. Consider removing it to reduce dead code and improve clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/kit/src/loader/config.ts(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: codeql (actions)
- GitHub Check: codeql (javascript-typescript)
- GitHub Check: build
- GitHub Check: code
🔇 Additional comments (2)
packages/kit/src/loader/config.ts (2)
126-126: Explicit union type forurlsimproves clarity
TypingurlsasArray<URL | string>clearly documents that it may contain both file URLs and raw paths.
129-129: Prevent double-urlification by unshifting rawnuxtPath
Directly addingnuxtPathfixes the double-URL conversion bug. Please verify thatresolveModuleURLaccepts an array for itsfromoption to guarantee proper schema resolution.
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where file URLs were being converted twice when resolving @nuxt/schema, causing resolution failures within the Nuxt directory.
- Added
resolveModulePathimport and adjusted module URL resolution logic - Changed
urlsarray to accept bothURLandstringtypes - Removed redundant
pathToFileURLconversion for already-resolved module paths
Comments suppressed due to low confidence (1)
packages/kit/src/loader/config.ts:127
- Add a unit test to cover both string and URL inputs for
loadNuxtSchema, ensuring file URLs are not double-urlified when resolving@nuxt/schema.
const nuxtPath = resolveModuleURL('nuxt', { try: true, from: url })
@nuxt/kit
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
CodSpeed Performance ReportMerging #32354 will not alter performanceComparing Summary
|
🔗 Linked issue
resolves #32311
📚 Description
we were wrongly converting file URLs to file URLs, meaning nuxt/schema wasn't being resolved from within the nuxt directory.