Closed AsakuraMizu closed 1 month ago
确认为 Vite 5 引起了此问题;但是实际上如果把生成的 serviceWorker.js
进行一下手动修改
// import "http://localhost:5173/@vite/client";
import "http://localhost:5173/src/background.ts";
似乎也能够正常工作
考虑到 https://github.com/samrum/vite-plugin-web-extension 的维护不是很 active,以往使用中问题也较多,计划切换到更 active 也更完善的 https://github.com/aklinker1/vite-plugin-web-extension/
好像不管是换 https://github.com/wxt-dev/wxt 还是 https://github.com/aklinker1/vite-plugin-web-extension 改动都有点大,先把 vite 回退到 v4 了
Service worker registration failed. Status code: 15
和Uncaught ReferenceError: document is not defined
的错误提示,其中第二条错误的 Stack Trace 显示为初步判断是 c985819 引起的,在 50e3165 中没有该问题,而在 8e8025a 中则可以复现此问题