branch:refactor/mv3 Popup shows "Vite server did not start"
heavenkiller2018 opened this issue · comments
Describe the bug
I donwloaded the latest mv3 branch, and then run it:
npx degit antfu/vitesse-webext#refactor/mv3 antfu@vitesse-webext_mv3
❯ npm run dev
> vitesse-webext@0.0.1 dev
> npm run clear && cross-env NODE_ENV=development run-p dev:*
> vitesse-webext@0.0.1 clear
> rimraf extension extension.*
> vitesse-webext@0.0.1 dev:js
> npm run build:js -- --mode development
> vitesse-webext@0.0.1 dev:bg
> tsup --watch ./src
> vitesse-webext@0.0.1 dev:prepare
> esno scripts/prepare.ts
> vitesse-webext@0.0.1 dev:web
> vite
CLI Building entry: {"background/index":"./src/background/index.ts","mv3client":"./scripts/client.ts"}
CLI Using tsconfig: tsconfig.json
CLI tsup v5.12.9
CLI Using tsup config: /home/john/project/testscratch/git-repos/antfu@vitesse-webext_mv3/tsup.config.ts
CLI Running in watch mode
CLI Target: esnext
ESM Build start
ESM ⚡️ Build success in 36ms
ESM extension/dist/mv3client.mjs 52.13 KB
ESM extension/dist/background/index.mjs 162.94 KB
CLI Watching for changes in "./src"
CLI Ignoring changes in "**/{.git,node_modules}/**" | "extension/dist" | "**/extension/**"
> vitesse-webext@0.0.1 build:js
> vite build --config vite.config.content.ts --mode development
build.terserOptions is specified but build.minify is not set to use Terser. Note Vite now defaults to use esbuild for minification. If you still prefer Terser, set build.minify to "terser".
vite v2.9.15 dev server running at:
> Local: http://localhost:3303/
> Network: use `--host` to expose
ready in 766ms.
vite v2.9.15 building for development...
watching for file changes...
build started...
transforming (12) contentScripts/views/App.vue PRE write manifest.json
PRE stub options
PRE stub popup
✓ 21 modules transformed.
../extension/dist/contentScripts/style.css 3.11 KiB / gzip: 1.05 KiB
../extension/dist/contentScripts/index.global.js 96.18 KiB / gzip: 37.06 KiB
../extension/dist/contentScripts/index.global.js.map 702.67 KiB
built in 4854ms.
but the popup page show: Vite server did not start
, why ? how to fix it?
Reproduction
reproduction
System Info
System:
OS: Linux 5.15 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (8) x64 Intel Core Processor (Haswell, no TSX, IBRS)
Memory: 25.33 GB / 31.35 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 18.12.0 - ~/.nvm/versions/node/v18.12.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.12.0/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v18.12.0/bin/npm
Browsers:
Chrome: 103.0.5060.53
Firefox: 105.0
Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
I found what the problem is. my development enviroment is vscode remote (linux), but my local os is windows. so in vite-mv3-hmr.ts
, isWin
is false
. I staticly set it to be true, then everything is ok! but there is another problem that it's not a real HMR which only need to refresh the web page to reflect the changes. In fact, I have to reload this extension to see the changes every time when the source code is modified? why? and how to improve it?
In fact, I have to reload this extension to see the changes every time when the source code is modified? why? and how to improve it?
#59 (comment), busy now, maybe I will have a look at it in some days 🤯.
I finally found what the problem is. I use raidrive to map the remote linux directory to local windows os with webdav, but there is delay in that manner when files syncing. I changed it to samba, then everything is ok! The HMR works😍😍😍