You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: resolve runtime imports in projects under a path with spaces or non-ASCII characters - #806
nuxt-module-build build fails when the module lives under a path with a space or a non-ASCII character (~/My Modules/…, ~/Документы/…): rollup cannot resolve the runtime imports of module.ts and the type build stops with Cannot find module …/src/runtime/…, so module.d.mts and types.d.mts are never written.
The runtime-externals plugin swaps the source directory for the output directory on a file URL:
href percent-encodes spaces and non-ASCII characters while entry.input is a plain path, so nothing is replaced, and the import keeps pointing at src/runtime/… without an extension. The fix swaps the directories on the path first and converts to a URL afterwards.
The new test builds a copy of the example under .temp-example with spaces ü. It fails without the change and passes with it; the existing tests already fail before the change when the repository itself is checked out under such a path.
No actionable comments were generated in the recent review.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 07d5ba11-5847-41e2-ad54-548acb75662c
Commits
Reviewing files that changed from the base of the PR and between 11d2b8e and 5b8931d.
Files selected for processing: 1
src/commands/build.ts
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
Walkthrough
The runtime external resolver now substitutes entry.input with entry.outDir in the filesystem path before converting it to a file URL. The build tests add an example path containing spaces and a non-ASCII character, prepare and pre-pack it, and check that its generated declaration includes the .js runtime import extension.
No actionable correctness or availability risk remains in this change.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title names the main change: runtime import resolution fails under paths with spaces or non-ASCII characters, and the fix addresses that. It is a conventional fix-prefixed, single-sentence title t…
Description check
The description explains the failure (nuxt-module-build build under paths with spaces or non-ASCII characters), gives the cause (the runtime-externals plugin replaces the directory after URL percent-e…
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: runtime import resolution fails under paths with spaces or non-ASCII characters, and the fix addresses that. It is a conventional fix-prefixed, single-sentence title that a teammate scanning history can understand. It is slightly long at 89 characters, but it stays specific.
Full details: Description check
Explanation
The description explains the failure (nuxt-module-build build under paths with spaces or non-ASCII characters), gives the cause (the runtime-externals plugin replaces the directory after URL percent-encoding), describes the fix (swap directories on the path before converting to a URL), and mentions the new test. It is directly related to the changeset.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
src/commands/build.ts
Parsing error: Unexpected token {
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
nuxt-module-build buildfails when the module lives under a path with a space or a non-ASCII character (~/My Modules/…,~/Документы/…): rollup cannot resolve the runtime imports ofmodule.tsand the type build stops withCannot find module …/src/runtime/…, somodule.d.mtsandtypes.d.mtsare never written.The runtime-externals plugin swaps the source directory for the output directory on a file URL:
hrefpercent-encodes spaces and non-ASCII characters whileentry.inputis a plain path, so nothing is replaced, and the import keeps pointing atsrc/runtime/…without an extension. The fix swaps the directories on the path first and converts to a URL afterwards.The new test builds a copy of the example under
.temp-example with spaces ü. It fails without the change and passes with it; the existing tests already fail before the change when the repository itself is checked out under such a path.