chrome-extension-tools
chrome-extension-tools copied to clipboard
The script resource is behind a redirect, which is disallowed
Build tool
Vite
Where do you see the problem?
- [X] In the browser
- [ ] In the terminal
Describe the bug
I get the message described in the title right after loading the 'dist' folder into chrome. The error message appears in the extension's card 'Error' button.
If I comment out the two imports from service-worker-loader.js
, the error disappears:
// import 'http://localhost:5173/@vite/env';
// import 'http://localhost:5173/@crx/client-worker';
To be clear, I get this error before doing anything inside the project, just right after npm init vite@latest
followed by npm i @crxjs/vite-plugin@beta -D
. The same problem occurs when using vite 2.
Has anybody else experienced this issue?
Reproduction
No repo.
Logs
No response
System Info
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Memory: 9.67 GB / 15.94 GB
Binaries:
Node: 18.16.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 9.6.5 - ~\AppData\Roaming\npm\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (113.0.1774.57)
Severity
annoyance
Same issue
Could not reproduce - works just fine. What versions of vite, @crxjs/vite-plugin are you using?
Working code (branch service-worker) https://github.com/Toumash/react-extension-vite-template/tree/service-worker-sample
No errors
have the same error, but it works anyway
I recently encountered this issue where Chrome automatically redirects http://localhost:5173 to https://localhost:5173. This error occurred because of my other Vite projects using the https protocol.
To resolve this, you just need to go to chrome://net-internals/#hsts
and clear the "Delete domain security policies" option. Enter "localhost" in the "Domain" field and click "delete".