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

Content Script HMR does not work with CSS Modules #898

Open
1 of 2 tasks
Noir-Lime opened this issue Jun 20, 2024 · 0 comments
Open
1 of 2 tasks

Content Script HMR does not work with CSS Modules #898

Noir-Lime opened this issue Jun 20, 2024 · 0 comments

Comments

@Noir-Lime
Copy link

Noir-Lime commented Jun 20, 2024

Build tool

Vite

Where do you see the problem?

  • In the browser
  • In the terminal

Describe the bug

My org is currently looking to migrate to a Framework to facilitate development of our Chrome Extension.
Currently, our top 2 picks are this library and Plasmo.
Our current tech stack is React + CSS Modules + SCSS.
To us, the big selling point of this library is that HMR works for Content Scripts.
However, if HMR doesn't work for styling changes and we're forced to refresh the page anyways, it disrupts development workflow too much and defeats the purpose of having HMR at all.
Without Content Scripts HMR, Plasmo appears to be the more attractive option.
Personally, I hope this is fixed or addressed soon before a decision is made in my org because after playing around with this library, I'd say I prefer it over Plasmo.

Basically:
CSS modules breaks HMR in content-scripts. This does not happen in Popups.

Reproduction

https://github.com/Noir-Lime/crx-bug

Reproduction steps are in Readme.

Logs

No response

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (8) x64 AMD Ryzen 7 5800X3D 8-Core Processor
    Memory: 5.75 GB / 15.62 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v18.18.2/bin/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
    pnpm: 9.3.0 - ~/.local/share/pnpm/pnpm
    bun: 1.1.6 - ~/.bun/bin/bun
  npmPackages:
    @crxjs/vite-plugin: 2.0.0-beta.23 => 2.0.0-beta.23 
    vite: ^5.2.0 => 5.3.1

Severity

blocking all usage of RPCE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant