aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
541 stars 47 forks source link

HMR doesn't work on Windows #107

Closed ListenV closed 1 year ago

ListenV commented 1 year ago

Summary

When I modified the code, the page didn't change at all in DEV mode.

Watch mode is the same as well.

Or is it my fault?

My browser is Google Chrome and the version is 113.0.5672.93.

Environment

  System:
    OS: Windows 10 10.0.22621
    CPU: (6) x64 Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
    Memory: 5.39 GB / 15.94 GB
  Binaries:
    Node: 18.16.0 - D:\Development\Scoop\apps\nodejs-lts\current\node.EXE
    npm: 9.5.1 - D:\Development\Scoop\apps\nodejs-lts\current\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.1702.0), Chromium (113.0.1774.35)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vite: ^4.3.5 => 4.3.5
    vite-plugin-web-extension: ^3.0.7 => 3.0.7
aklinker1 commented 1 year ago

I need more info. Was it working on a previous version? Can you share a repo that I can reproduce the error on?

ListenV commented 1 year ago

I'm so sorry. the repo file: demo-vue.zip and video:

https://github.com/aklinker1/vite-plugin-web-extension/assets/45219522/04d9eb7c-e1f0-46c4-9cf7-df8222a3808d

aklinker1 commented 1 year ago

No worries! Thanks for the info. I'll try and get to it this weekend... But the new Zelda game is out so we'll see lol.

codingyu commented 1 year ago

No worries! Thanks for the info. I'll try and get to it this weekend... But the new Zelda game is out so we'll see lol. 🥲

aklinker1 commented 1 year ago

@ListenV I cannot reproduce with the ZIP you sent me on mac.

https://github.com/aklinker1/vite-plugin-web-extension/assets/10101283/d0954f58-c7c1-4b3f-bb34-4f7b233875e7

That makes me think your version of Chrome is not above v110. HMR requires chrome v110 or above. Can you share your chrome version as well? I only see edge in the issue description. Right clicking and inspecting your popup's console would also be helpful to diagnose the problem.

https://github.com/aklinker1/vite-plugin-web-extension/assets/10101283/d45120e1-97c9-4247-aee5-aee46665bcab

If you want to test on Edge instead of Chrome, you can set the chromiumBinary path in your .webextrc.yml file:

# ~/.webextrc.yml
chromiumBinary: C:\path\to\edge.exe
codingyu commented 1 year ago

@aklinker1 I had the same problem, it seemed like it didn't compile after saving the file.

aklinker1 commented 1 year ago

@codingyu Are you able to share your code and your browser version?

codingyu commented 1 year ago

@aklinker1 New project created per docs(vue-js)

Win11 node v16.14.0 Chrome Version 113.0.5672.127 (Official Build) (64-bit)

aklinker1 commented 1 year ago

@codingyu Not seeing any issues with the vue-js template either. Can you share a screenshot of the popup's console, with verbose logs enabled?

https://github.com/aklinker1/vite-plugin-web-extension/assets/10101283/f19b5ca8-5442-45b2-a3fb-34a3fd351401

Maybe it's a windows issue? I'll try it out later today on windows, I don't use my windows computer often.

codingyu commented 1 year ago

https://github.com/aklinker1/vite-plugin-web-extension/assets/20354841/e5549538-6704-4ecd-9405-673269a8a5ba

@aklinker1

ListenV commented 1 year ago

I am like @codingyu, and there are no errors displayed in the popup's console. My Chrome Version is 113.0.5672.127 (Official Build) (64-bit). It's latest already and above v110.

Env:

Win11 Google Chrome Version: 113.0.5672.127 (Official Build) (64-bit) Node: v18.16.0 Vite: 4.3.8 Vue: 3.3.4 vite-plugin-web-extension: "3.0.8"

aklinker1 commented 1 year ago

Ok, I tried it out on windows, and it's not working. I'll get it fixed

aklinker1 commented 1 year ago

Fix released in v3.0.9

Honsal commented 11 months ago

@aklinker1 It seems broken again. Even the project is default state, created by using pnpm create vite-plugin-web-extension

Windows 11 22H2 22621.1992 Lang: ko-KR Line Endings: LF Chrome 114.0.5735.199 (64 bit)

https://github.com/aklinker1/vite-plugin-web-extension/assets/13115858/3ed116f8-8c5e-4fec-82e7-c0036349f756

aklinker1 commented 11 months ago

@Honsal thanks for sharing, I'll test it out again in a bit.

Honsal commented 11 months ago

Additional Condition

If there's weird sentences so you cannot easily understand, please tell me. I am not native so i will pick some translator.