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

PostCSS/webpack5: registering newly-created dependency causes initial dev build to hang #23125

Closed
bradlc opened this issue Mar 16, 2021 · 1 comment · Fixed by webpack/webpack#12915 or #23224
Labels
bug Issue was opened via the bug report template.

Comments

@bradlc
Copy link
Contributor

bradlc commented Mar 16, 2021

What version of Next.js are you using?

10.0.9 / 10.0.10-canary.0

What version of Node.js are you using?

14.5.0

What browser are you using?

Chrome

What operating system are you using?

macOS 11.0.1

How are you deploying your application?

N/A

Describe the Bug

When using webpack5 (future.webpack5 = true) the Next.js dev server hangs when a PostCSS plugin registers a dependency which has just been created.

// Create a new file
fs.closeSync(fs.openSync(dependency, 'w'))

// Register that file as a dependency
result.messages.push({
  type: 'dependency',
  plugin: PLUGIN_NAME,
  parent: result.opts.from,
  file: dependency,
})

This issue does not seem to exist prior to #22737 when webpack5 was upgraded to v5.24.3. Additionally, the dev server only hangs on the initial build (i.e. when the .next folder does not exist)

Expected Behavior

The dev server should not hang.

To Reproduce

  1. Clone https://github.com/bradlc/next-postcss-issue
  2. Run npm install
  3. Ensure that the .next folder does not exist
  4. Run npm run dev
@bradlc bradlc added the bug Issue was opened via the bug report template. label Mar 16, 2021
sokra added a commit to webpack/webpack that referenced this issue Mar 17, 2021
@sokra sokra mentioned this issue Mar 19, 2021
8 tasks
kodiakhq bot pushed a commit that referenced this issue Mar 22, 2021
fixes #23125

fixes tailwindlabs/tailwindcss-jit#54

## Bug

- [ ] 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.
- [ ] Related issues linked using `fixes #number`
- [ ] 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
flybayer pushed a commit to blitz-js/next.js that referenced this issue Apr 29, 2021
fixes vercel#23125

fixes tailwindlabs/tailwindcss-jit#54

## Bug

- [ ] 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.
- [ ] Related issues linked using `fixes #number`
- [ ] 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
bug Issue was opened via the bug report template.
Projects
None yet
2 participants