Unverified Commit 83e19a25 authored by Shu Ding's avatar Shu Ding Committed by GitHub

Fix entry creation on Windows (#42421)

In Windows absolute paths start with things like `C:\` instead of `/`.
This PR closes #42024 as I confirmed the reproduction app is working
properly with this fix.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
parent 4af50116
...@@ -189,7 +189,7 @@ export class FlightClientEntryPlugin { ...@@ -189,7 +189,7 @@ export class FlightClientEntryPlugin {
dependency: layoutOrPageDependency, dependency: layoutOrPageDependency,
}) })
const isAbsoluteRequest = layoutOrPageRequest[0] === '/' const isAbsoluteRequest = path.isAbsolute(layoutOrPageRequest)
// Next.js internals are put into a separate entry. // Next.js internals are put into a separate entry.
if (!isAbsoluteRequest) { if (!isAbsoluteRequest) {
......
...@@ -201,7 +201,7 @@ export class FlightManifestPlugin { ...@@ -201,7 +201,7 @@ export class FlightManifestPlugin {
}, },
} }
} else { } else {
// It is possible that there are mtuliepl modules with the same resouce, // It is possible that there are multiple modules with the same resource,
// e.g. extracted by mini-css-extract-plugin. In that case we need to // e.g. extracted by mini-css-extract-plugin. In that case we need to
// merge the chunks. // merge the chunks.
manifest[resource].default.chunks = [ manifest[resource].default.chunks = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment