antfu-collective / vitesse-webext

⚡️ WebExtension Vite Starter Template
MIT License
2.93k stars 225 forks source link

on running pnpm dev, got SyntaxError. #115

Closed PhantasWeng closed 1 year ago

PhantasWeng commented 1 year ago

Describe the bug

npx degit antfu/vitesse-webext my-webext
cd my-webext
pnpm i

...
pnpm dev

Fallow the installation guide and run pnpm dev, and will occurred SyntaxError

Reproduction

~/Code/playground/pr-compare  pnpm dev                                                                                                                                                                               

> github-pr-compare@0.0.1 dev /Users/{project-path}
> npm run clear && cross-env NODE_ENV=development run-p dev:*

> github-pr-compare@0.0.1 clear
> rimraf extension extension.*

> github-pr-compare@0.0.1 dev:prepare /Users/{project-path}
> esno scripts/prepare.ts

> github-pr-compare@0.0.1 dev:web /Users/{project-path}
> vite

> github-pr-compare@0.0.1 dev:js /Users/{project-path}
> npm run build:js -- --mode development

> github-pr-compare@0.0.1 dev:bg /Users/{project-path}
> tsup --watch ./src

> github-pr-compare@0.0.1 build:js
> vite build --config vite.config.content.ts --mode development

SyntaxError: Unexpected token '||='
    at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
    at async link (internal/modules/esm/module_job.js:67:21)
 ELIFECYCLE  Command failed with exit code 1.
Error: The service is no longer running
    at /Users/{project-path}/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:801:29
    at sendRequest (/Users/{project-path}/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:676:14)
    at start (/Users/{project-path}/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:799:9)
    at Object.transform2 [as transform] (/Users/{project-path}/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:856:5)
    at /Users/{project-path}/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:2121:55
    at new Promise (<anonymous>)
    at Object.transform (/Users/{project-path}/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:2121:14)
    at /Users/{project-path}/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:2273:67
    at MessagePort.<anonymous> (/Users/{project-path}/node_modules/.pnpm/esbuild@0.15.18/node_modules/esbuild/lib/main.js:2289:9)
    at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:399:24)
 ELIFECYCLE  Command failed.
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed.
ERROR: "dev:bg" exited with 1.
 ELIFECYCLE  Command failed with exit code 1.

System Info

System:
    OS: macOS 13.1
    CPU: (8) x64 Apple M1
    Memory: 23.98 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.18.2 - ~/.nvm/versions/node/v14.18.2/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v14.18.2/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v14.18.2/bin/npm
  Browsers:
    Chrome: 109.0.5414.119
    Firefox: 99.0.1
    Safari: 16.2

Used Package Manager

pnpm

Validations

antfu commented 1 year ago

Please upgrade your node