Vue-loader: Hot Module Reloading Broken when using CSS modules

Created on 6 Jun 2017  路  4Comments  路  Source: vuejs/vue-loader

Version

12.2.1

Reproduction link

https://github.com/trainiac/hmr-vue-loader-12-bug

Steps to reproduce

  1. Run the server
    $ git clone [email protected]:trainiac/hmr-vue-loader-12-bug.git
    $ cd hmr-vue-loader-12-bug
    $ npm install
    $ node ./server.js

  2. Edit anything in the script section of App.vue and save

  3. Notice the error in the console.

What is expected?

Hot update

What is actually happening?

An error is being thrown

Uncaught TypeError: Cannot read property 'hot' of undefined


I've tested vue-loader 11.0.0 and this bug does not exist. I also don't get this bug without using CSS modules.

css modules

Most helpful comment

I'm reopening this because it appears to still be broken. https://github.com/vuejs/vue-loader/issues/801

All 4 comments

I'm reopening this because it appears to still be broken. https://github.com/vuejs/vue-loader/issues/801

I submitted a PR to webpack. Could be a bug on their end. https://github.com/webpack/webpack/pull/5281

HMR broken when using css module with src

<style src="./list.scss" lang="scss" module></style>

When you are using a preprocessor it breaks hot reload, work only with plain css in your css modules then works all fine.

Best

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NextSeason picture NextSeason  路  3Comments

Makio64 picture Makio64  路  4Comments

chrisvfritz picture chrisvfritz  路  4Comments

C0deZLee picture C0deZLee  路  3Comments

frangio picture frangio  路  3Comments