-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
fix(kit): do not double-urlify file urls when resolving schema #32354
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/kit/src/loader/config.ts (1)
11-11
: Remove unusedresolveModulePath
import
TheresolveModulePath
symbol 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 forurls
improves clarity
Typingurls
asArray<URL | string>
clearly documents that it may contain both file URLs and raw paths.
129-129
: Prevent double-urlification by unshifting rawnuxtPath
Directly addingnuxtPath
fixes the double-URL conversion bug. Please verify thatresolveModuleURL
accepts an array for itsfrom
option to guarantee proper schema resolution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
resolveModulePath
import and adjusted module URL resolution logic - Changed
urls
array to accept bothURL
andstring
types - Removed redundant
pathToFileURL
conversion 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.