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

Webpack 5 mode does not work yet with custom configurations #23130

Closed
PepijnSenders opened this issue Mar 17, 2021 · 7 comments · Fixed by #24603
Closed

Webpack 5 mode does not work yet with custom configurations #23130

PepijnSenders opened this issue Mar 17, 2021 · 7 comments · Fixed by #24603
Milestone

Comments

@PepijnSenders
Copy link
Contributor

What version of Next.js are you using?

canary

What version of Node.js are you using?

15

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

none

Describe the Bug

Webpack's aliases configuration does not yet work with future.webpack5 = true.

Expected Behavior

Aliases and other configurations to properly work with webpack5.

To Reproduce

I made a simple test repo that showcases the issue: https://github.com/PepijnSenders/nextjs-aliases-issue.

Just run yarn && yarn next and load localhost:3000 to view the error.

@PepijnSenders PepijnSenders added the bug Issue was opened via the bug report template. label Mar 17, 2021
@rauchg
Copy link
Member

rauchg commented Mar 29, 2021

Bumping this one since it impacts our Preact support. Thanks @JoviDeCroock for raising this as well.

@timneutkens timneutkens added type: needs investigation and removed bug Issue was opened via the bug report template. labels Mar 30, 2021
@timneutkens timneutkens added this to the 10.x.x milestone Mar 30, 2021
@Timer Timer removed this from the 10.x.x milestone Mar 30, 2021
@poloboc
Copy link

poloboc commented Mar 30, 2021

Also, distDir won't work properly, .next folder is created anyway

@Timer Timer modified the milestones: Iteration 18, 10.x.x Mar 31, 2021
@felipeptcho
Copy link
Contributor

@poloboc I fixed the distDir issue here: #23718

@PepijnSenders
Copy link
Contributor Author

FYI; this did not fix the main issue.

@PepijnSenders
Copy link
Contributor Author

The error has now evolved to:

Error: Failed to load /
    at loadComponents (/Users/psenders/Documents/GitHub/next-test/node_modules/next/dist/next-server/server/load-components.js:1:1554)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async DevServer.findPageComponents (/Users/psenders/Documents/GitHub/next-test/node_modules/next/dist/next-server/server/next-server.js:76:257)
    at async DevServer.renderToHTML (/Users/psenders/Documents/GitHub/next-test/node_modules/next/dist/next-server/server/next-server.js:137:542)
    at async DevServer.renderToHTML (/Users/psenders/Documents/GitHub/next-test/node_modules/next/dist/server/next-dev-server.js:36:578)
    at async DevServer.render (/Users/psenders/Documents/GitHub/next-test/node_modules/next/dist/next-server/server/next-server.js:74:255)
    at async Object.fn (/Users/psenders/Documents/GitHub/next-test/node_modules/next/dist/next-server/server/next-server.js:58:672)
    at async Router.execute (/Users/psenders/Documents/GitHub/next-test/node_modules/next/dist/next-server/server/router.js:25:67)
    at async DevServer.run (/Users/psenders/Documents/GitHub/next-test/node_modules/next/dist/next-server/server/next-server.js:68:1042)
    at async DevServer.handleRequest (/Users/psenders/Documents/GitHub/next-test/node_modules/next/dist/next-server/server/next-server.js:32:504)

Still using the same (very simple) test repo: https://github.com/PepijnSenders/nextjs-aliases-issue

@kodiakhq kodiakhq bot closed this as completed in #24603 May 7, 2021
kodiakhq bot pushed a commit that referenced this issue May 7, 2021
* fix check in externals that validate if the require is resolve-able for the server
* performance improvements

Fixes #23130

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes
@PepijnSenders
Copy link
Contributor Author

Awesome, it works!

flybayer pushed a commit to blitz-js/next.js that referenced this issue Jun 1, 2021
* fix check in externals that validate if the require is resolve-able for the server
* performance improvements

Fixes vercel#23130

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants