Hi,
I was simply trying vite react template, and after having installed and simply running npm run dev I get:
ben @ tmp/react-vite > npm run dev
> [email protected] dev /Users/ben/pro/tmp/react-vite
> vite
vite v1.0.0-beta.4
Dev server running at:
> Local: http://localhost:3000/
> Network: http://192.168.8.111:3000/
> Network: http://10.212.134.212:3000/
ReferenceError: TextEncoder is not defined
at createChannel (/Users/ben/pro/tmp/react-vite/node_modules/esbuild/lib/main.js:102:17)
at Object.startService (/Users/ben/pro/tmp/react-vite/node_modules/esbuild/lib/main.js:338:47)
at ensureService (/Users/ben/pro/tmp/react-vite/node_modules/vite/dist/esbuildService.js:38:36)
at Object.exports.transform (/Users/ben/pro/tmp/react-vite/node_modules/vite/dist/esbuildService.js:49:27)
at app.use (/Users/ben/pro/tmp/react-vite/node_modules/vite/dist/server/serverPluginEsbuild.js:16:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
You didn't provide any information from the issue template. A reproduction would be really helpful.
@MarvinRudolph you are right sorry.
Here is a repo https://github.com/ciaoben/react-vite
I simply launched these commands from on my mac (10.15.4) with node v10.13.0:
mkdir react-vite
cd react-vite
npm init vite-app --template react
npm i
npm run dev
I'm the author of esbuild, the library that is crashing. It looks like TextEncoder works on node LTS but not on node 10.x. Upgrading to node LTS should fix the crash.
I just published a new version of esbuild that doesn't require TextEncoder. Updating vite to use esbuild 0.5.11 should fix this crash for all users on node 10.x.
@evanw Thanks for your point error.
Most helpful comment
I'm the author of esbuild, the library that is crashing. It looks like
TextEncoderworks on node LTS but not on node 10.x. Upgrading to node LTS should fix the crash.I just published a new version of esbuild that doesn't require
TextEncoder. Updating vite to use esbuild 0.5.11 should fix this crash for all users on node 10.x.