Skip to content

fix(vite): match service entry chunk by facadeModuleId#4123

Merged
pi0 merged 2 commits intomainfrom
fix/entry
Mar 23, 2026
Merged

fix(vite): match service entry chunk by facadeModuleId#4123
pi0 merged 2 commits intomainfrom
fix/entry

Conversation

@danielroe
Copy link
Member

@danielroe danielroe commented Mar 17, 2026

🔗 Linked issue

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)

📚 Description

when migrating nuxt to vite environment api, nitro was resolving the last chunk which was marked as an entry (in our case we were emitting a chunk which contained css for use in inlining styles).

this aims to match up the chunk to he service entry via facadeModuleId. if it fails, it falls back to the first chunk which is marked as an entry...

Note

I'm creating this PR although a lot of tests fail locally. I don't think this can be caused by this change... but just in case 🤷

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe requested a review from pi0 as a code owner March 17, 2026 10:11
@vercel
Copy link

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nitro.build Ready Ready Preview, Comment Mar 23, 2026 10:50pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4203acad-ea97-4b19-85ba-936702da6cc9

📥 Commits

Reviewing files that changed from the base of the PR and between e14976f and 6fae54e.

📒 Files selected for processing (1)
  • src/build/vite/plugin.ts

📝 Walkthrough

Walkthrough

The change modifies how the service entry chunk is identified during Vite builds. Instead of emitting warnings for multiple entry points, the code now uses the environment's registered service entry to precisely match and identify the correct entry chunk by comparing facadeModuleId values.

Changes

Cohort / File(s) Summary
Service Entry Resolution
src/build/vite/plugin.ts
Refactored service entry chunk identification logic to resolve and match against the registered service entry in the current environment, replacing the previous warning-based approach with precise facadeModuleId comparison and fallback to first discovered entry chunk.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format with type 'fix' and clearly describes the change: matching service entry chunks by facadeModuleId.
Description check ✅ Passed The description is related to the changeset, explaining the bug being fixed and the approach taken to resolve it with the facadeModuleId matching strategy.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/entry
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can customize the tone of the review comments and chat replies.

Configure the tone_instructions setting to customize the tone of the review comments and chat replies. For example, you can set the tone to Act like a strict teacher, Act like a pirate and more.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 17, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nitro@4123

commit: 6fae54e

@pi0 pi0 merged commit 01ad80d into main Mar 23, 2026
9 checks passed
@pi0 pi0 deleted the fix/entry branch March 23, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants