Repository navigation
fix(vite): find the entry of a service environment marked as built - #5007
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
FindingsActionable comments posted: 2 Caution Review failedThe pull request is closed.
|
| Layer / File(s) | Summary |
|---|---|
Record service entry filenames src/build/vite/services.ts, src/build/vite/plugin.ts |
Nitro defines a service manifest filename and a helper that reads its entry, falls back to index.mjs, or throws an error. Bundle generation emits the service entry filename in the manifest. |
Resolve entries for built environments src/build/vite/prod.ts, test/vite/built-service-fixture/*, test/vite/built-service.test.ts |
When a built environment has a matching service but no entry point, Nitro reads its entry from the output directory. The test builds with a hashed entry filename and checks that the generated server handles a request. |
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
- vite: let a framework build an environment in another process #4974 — This PR resolves the entry for an already-built Vite service; the issue’s readiness and cleanup requirements remain separate.
Suggested labels: vite plugin
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
commit: |
Nitro only learned a service's entry file in that environment's `generateBundle`, so a service marked `isBuilt` before Nitro's `buildApp` imported its output folder, which fails unless the entry is `index.mjs`. Service builds now write a `nitro-service.json` manifest next to their output, read back when the environment is skipped. Resolves #5005 Co-authored-by: onmax <[email protected]>
e96fea9 to
5572b24
Compare
Resolves #5005
A service environment marked
isBuiltbefore Nitro'sbuildApp(e.g. ssr output restored from a framework build cache) is skipped, so itsgenerateBundlenever runs and Nitro never learns its entry file.#nitro/virtual/vite-servicesthen imports the output folder, which only resolves when the entry isindex.{mjs,js}.nitro-service.jsonmanifest ({ entry }) next to their output.Based on the fix by @onmax (co-authored).
🤖 Generated with AI assistant