You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
Running npm run build on the react-ts template drops a build error due to the const [count, setCount] = useState(0); line in the src/App.tsx file, being reported as 'not supported'.
error during build:
Error: Transform failed with 1 error:
assets/index.d6b4819c.js:48:8: error: Transforming destructuring to the configured target environment ("chrome61", "edge16", "es2019", "firefox60", "safari11") is not supported yet
at failureErrorWithLog (PROJET_PATH/node_modules/esbuild/lib/main.js:1195:15)
at PROJET_PATH/node_modules/esbuild/lib/main.js:1056:33
at PROJET_PATH/node_modules/esbuild/lib/main.js:566:9
at handleIncomingPacket (PROJET_PATH/node_modules/esbuild/lib/main.js:655:9)
at Socket.readFromStdout (PROJET_PATH/node_modules/esbuild/lib/main.js:533:7)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:284:9)
at Socket.Readable.push (_stream_readable.js:223:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
Removing the destructuration at the line 6 of the src/App.tsx file fixes the issue and it builds properly, but I don't think this is intented.
Reproduction
npm init @vitejs/app test # Select the `react-ts` template
cd test
npm i
npm run build
System Info
Tested on two different setups, both dropping the same error :
First setup:
vite version: vite/2.1.1 darwin-x64 node-v14.15.1
Operating System: macOS 11.1 (Hackintosh on Intel CPU)
Node version: 14.15.1
Package manager (npm/yarn/pnpm) and version: NPM 6.14.8
Second setup:
vite version: vite/2.1.1 linux-x64 node-v15.8.0
Operating System: NixOS 20.09
Node version: 15.8.0
Package manager (npm/yarn/pnpm) and version: NPM 7.5.1
Describe the bug
Running
npm run build
on thereact-ts
template drops a build error due to theconst [count, setCount] = useState(0);
line in the src/App.tsx file, being reported as 'not supported'.Removing the destructuration at the line 6 of the
src/App.tsx
file fixes the issue and it builds properly, but I don't think this is intented.Reproduction
System Info
Tested on two different setups, both dropping the same error :
First setup:
vite
version:vite/2.1.1 darwin-x64 node-v14.15.1
macOS 11.1 (Hackintosh on Intel CPU)
14.15.1
NPM 6.14.8
Second setup:
vite
version:vite/2.1.1 linux-x64 node-v15.8.0
NixOS 20.09
15.8.0
NPM 7.5.1
Logs (Optional if provided reproduction)
The text was updated successfully, but these errors were encountered: