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
> [email protected] build
> vite build
vite v5.2.12 building for production...
✓ 16 modules transformed.
dist/assets/index-legacy-4yahLsja.js 67.23 kB │ gzip: 24.37 kB
dist/assets/polyfills-legacy-Lh3Ygw8X.js 79.60 kB │ gzip: 32.16 kB
x Build failed in 3.94s
error during build:
[vite:esbuild-transpile] Transform failed with 1 error:
assets/index-!~{001}~.js:5726:12: ERROR: Big integer literals are not available in the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari
12" + 2 overrides)
Big integer literals are not available in the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari12" + 2 overrides)
5724| const App = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-d6420450"]]);
5725|
5726| console.log(123n);
| ^
5727|
5728| createApp(App).mount('#app');
at failureErrorWithLog (/home/jwcooper/dev/tmp/bigint/node_modules/esbuild/lib/main.js:1651:15)
at /home/jwcooper/dev/tmp/bigint/node_modules/esbuild/lib/main.js:849:29
at responseCallbacks.<computed> (/home/jwcooper/dev/tmp/bigint/node_modules/esbuild/lib/main.js:704:9)
at handleIncomingPacket (/home/jwcooper/dev/tmp/bigint/node_modules/esbuild/lib/main.js:764:9)
at Socket.readFromStdout (/home/jwcooper/dev/tmp/bigint/node_modules/esbuild/lib/main.js:680:7)
at Socket.emit (node:events:518:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
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 vuejs/core instead.
Yeah I think this is expected. It's not possible to downlevel BigInt to be used in older browsers that don't support it. However, if you want to get the build passing you can configure this:
esbuild: {supported: {bigint: true}}
So that esbuild will assume that bigint will be supported. However your site will not work when it runs the file that contains the BigInt syntax.
Describe the bug
Using defaults, vite plugin legacy errors out on a statement such as
console.log(123n)
console.log(BigInt(123))
works just fine.Reproduction
https://github.com/jwcooper/vite-bigint
Steps to reproduce
Run
npm install
followed bynpm run build
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: