Skip to content

fix: path issues on linux machines when build created on windows#58398

Closed
keyur2582 wants to merge 3 commits into
vercel:canaryfrom
masterpiecevr:canary
Closed

fix: path issues on linux machines when build created on windows#58398
keyur2582 wants to merge 3 commits into
vercel:canaryfrom
masterpiecevr:canary

Conversation

@keyur2582

Copy link
Copy Markdown
Contributor

What?

The user gets an internal error 500 when visiting your website. You get "Error: Cannot find module 'next/dist\client\components\static-generation-async-storage-external.js'" on server logs. The specifics can be found in #56010.

Why?

If build was created on windows it is using '\' in the paths whereas it has to be replaced with '/'. If the same build is deployed to linux based machines like app engine, it throws the error above.

How?

By replacing
return commonjs ${localRes.replace(/.*?next[/\]dist/, "next/dist")}with return commonjs ${localRes.replace(/.*?next[/\\]dist/, "next/dist").replace(/\\/g, "/")}`` in next\build\handle-externals.js`

Closes NEXT-58244
Fixes #58244

-->

@bartoszpytka

Copy link
Copy Markdown

Im looking forward to have this fix :)

@alexop1000

Copy link
Copy Markdown

Do you have any update on getting this merged? A lot of us are waiting for this tiny fix🙏

@clearly-outsane

Copy link
Copy Markdown

Looking forward to this!

@alexop1000

alexop1000 commented Nov 22, 2023

Copy link
Copy Markdown

Hi @ztanner or anyone, sorry for the ping, but could we get a review? It's a one-line fix so it should only take a few minutes of your time, and help a lot of people.

@CampbellReid

Copy link
Copy Markdown

@ztanner Following suit from @alexop1000 Pinging this too as it is still happening on Dec 30.

@spsesha

spsesha commented Jan 1, 2024

Copy link
Copy Markdown

Pinging this to follow up, this is still happening. Please take a look into this as this is simple fix
@timneutkens @ijjk @ztanner

@Enngage

Enngage commented Jan 2, 2024

Copy link
Copy Markdown

Yes, please... just merge this PR for the sake of all of us.

@timneutkens

Copy link
Copy Markdown
Contributor

Hey, thanks for looking into this! I just had a look and this change looks fine, it seems the tests did not run because of the branch not being editable and I can't trigger a branch update either, probably because it was opened on an organization instead of an individual. I've opened #60116 so that this change can be landed, you'll be credited in the same way, as it's the same commits.

timneutkens added a commit that referenced this pull request Jan 2, 2024
Copy of #58398 with `normalizePathSep` applied. Unfortunately the branch
wasn't editable, I'm guessing because it was opened on an organization
instead of an individual.

Fixes #58244
Closes #58398

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-1943

---------

Co-authored-by: keyur2582 <[email protected]>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generating incorrect paths on assembly

9 participants