Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust wrangler patching logic to use the correct node_modules/next/dist directory #52

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

dario-piotrowicz
Copy link
Contributor

@dario-piotrowicz dario-piotrowicz commented Oct 2, 2024

Next.js saves the node_modules/next/dist directory for the app in either the normal standalone dir or in the
standalone root path, this depends on where the next dependency is actually saved (https://github.com/vercel/next.js/blob/39e06c75/packages/next/src/build/webpack-config.ts#L103-L104) and can depend on the package manager used, if it is using workspaces, etc...

Currently we're always using the normal standalone dir but this is incorrect and causes the package not to work in certain projects, this PR fixes such issue.


Note

I would have liked to add an e2e test for this, but since this is quite dependent on the package manager being used and the project structure I think that adding an e2e would be tricky (e.g. I'd have to force pnpm to put some dependecies in some locations somehow) and not too valuable (e.g. can I replicate what npm does in pnpm? what about yarn, etc...)


fixes #42

@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review October 2, 2024 17:22
@vicb vicb merged commit cf5113b into main Oct 3, 2024
2 checks passed
@vicb vicb deleted the dario/dist-path-fix branch October 3, 2024 11:11
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.

Error when building
2 participants