nuxt / nuxt/bridge

"webpackHotUpdate is not defined" error when using extractCSS option

Open
#43 5 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
285
Forks
33
Avg merge
22h 38m
Merged PRs (30d)
3

Description

Environment

  • Operating System: Linux
  • Node Version: v14.17.6
  • Nuxt Version: 2.16.0-27226092.034b9901
  • Package Manager: Yarn
  • Bundler: Webpack
  • User Config: css, build, buildModules
  • Runtime Modules: -
  • Build Modules: @nuxt/bridge@3.0.0-27245975.d1214c9

Describe the bug

When you add some css file to the css array and then turn on the build.extractCSS option in the nuxt config then change some template's content, the page will fully reload instead of updating the page itself and in the console you will see the following error:
image

Also I won't be surprised if this warning has some relation to this issue
image

Note that this bug goes away after you edit the template again. In a different project I had it stick for pretty much forever, though I'm not yet sure what causes it to stick, I'll try to create a minimal reproduction of it too if needed. I'm hoping that if this one is fixed, it might also fix it sticking around.

Reproduction

https://codesandbox.io/s/suspicious-pasteur-ycqi3?file=/pages/index.vue

Additional context

No response

Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and its pages/index.vue, enabling build.extractCSS while editing the template. Inspect the Nuxt Bridge/Webpack build and HMR paths handling the css and build configuration; done means template edits update without a full reload or webpackHotUpdate error, with regression coverage if an existing test path is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, node.js, nuxtjs, typescript, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.