Skip to content

Aborting CSS HMR due to changed css-modules locals when using react-hot-loader #320

@pattiereaves

Description

@pattiereaves

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When using the latest version of style-loader and react-hot-loader, the page will reload every time a change is made to a css file (regardless of the change being to a property or a selector). It provides the following error when doing a full page reload: Aborting CSS HMR due to changed css-modules locals. I believe this PR introduced the issue.

If the current behavior is a bug, please provide the steps to reproduce.
I am not entirely sure what about my configuration is causing this issue, but I suspect it is the combination of using css modules, react hot loader and style loader. See this comment. Downgrading to style-loader@0.19 fixes the issue. (Changes to CSS are applied to the page without a complete reload)

What is the expected behavior?
I can make changes to css and the changes will be applied using HMR.

If this is a feature request, what is motivation or use case for changing the behavior?
n/a

Please mention other relevant information such as your webpack version, Node.js version and Operating System.
node 8, npm 5
stylel-loader@0.21.0
"css-loader": "^0.28.11",
"react-hot-loader": "^4.0.1",
"webpack": "^4.2.0",
"webpack-dev-server": "^3.1.1"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions