Skip to content

Conversation

@cernymatej
Copy link
Member

📚 Description

This fixes an issue where the generated tsconfig paths in

const moduleDir = relativeWithDot(nuxt.options.buildDir, m)
return [
join(moduleDir, 'runtime/server'),
join(moduleDir, 'dist/runtime/server'),
]

were incorrect in some cases: (notice the index.ts there)

image

I matched the implementation with:

const moduleEntryPaths: string[] = []
for (const m of nuxt.options._installedModules) {
const path = m.meta?.rawPath || m.entryPath
if (path) {
moduleEntryPaths.push(getDirectory(path))
}
}

@cernymatej cernymatej requested a review from danielroe as a code owner November 1, 2025 20:04
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link

coderabbitai bot commented Nov 1, 2025

Walkthrough

The changes modify the Nitro bundle logic in the nitro-server package. The import statement is updated to include getDirectory from @nuxt/kit alongside the existing getLayerDirectories. Subsequently, the code that collects module entry paths is modified to process each path through the getDirectory function before adding it to the moduleEntryPaths array, replacing the previous direct path assignment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify that getDirectory is correctly imported and available from @nuxt/kit
  • Confirm that getDirectory(path) produces the intended output format for module entry paths and is compatible with downstream consumers of moduleEntryPaths
  • Ensure the change does not inadvertently alter the module resolution logic or break module loading functionality

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed The pull request description is clearly related to the changeset. It explains the issue being fixed—that generated tsconfig paths in packages/nitro-server/src/index.ts were incorrect, including file paths (e.g., index.ts) instead of directory paths—and references the specific code location and a related implementation for alignment. The description provides sufficient context about why this change was needed, making it directly relevant to the modifications in the changeset.
Title Check ✅ Passed The pull request title "fix(nitro): use directory paths in moduleEntryPaths" directly and accurately summarizes the main change in the changeset. The modification replaces raw path values with getDirectory(path) when populating moduleEntryPaths, which aligns precisely with the PR's objective to produce directory-based module entry paths for tsconfig generation instead of explicit file paths. The title is concise, specific, and clearly identifies both the component being modified and the nature of the fix, making it easy for reviewers to understand the primary intent.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 1, 2025

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@33628

nuxt

npm i https://pkg.pr.new/nuxt@33628

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@33628

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@33628

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@33628

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@33628

commit: fd76b36

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 1, 2025

CodSpeed Performance Report

Merging #33628 will not alter performance

Comparing cernymatej:fix/nitro-module-entry-paths (fd76b36) with main (89f59b7)

Summary

✅ 10 untouched

@danielroe danielroe changed the title fix(nuxt): use directory paths in moduleEntryPaths fix(nitro): use directory paths in moduleEntryPaths Nov 1, 2025
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

thank you ❤️

@danielroe danielroe merged commit 2f984b9 into nuxt:main Nov 3, 2025
101 of 102 checks passed
@github-actions github-actions bot mentioned this pull request Nov 3, 2025
@cernymatej cernymatej deleted the fix/nitro-module-entry-paths branch November 3, 2025 13:56
@github-actions github-actions bot mentioned this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants