question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error: Big integer literals are not available in the configured target environment ("chrome61", "edge18", "es2019", "firefox60", "safari11")

See original GitHub issue

Describe the bug

During build it throws with:

error: Big integer literals are not available in the configured target environment ("chrome61", "edge18", "es2019", "firefox60", "safari11")

To Reproduce

A new svelte@next init app and a minimal Getting started code from https://github.com/timostamm/protobuf-ts.

(I know, but I don’t have time right now for a new repo)

Expected behavior

I can build.

Can I change the target it detects? Can I remove that “es2019” for example?

Stacktraces

Stack trace
> Transform failed with 2 errors:
pages\players\index.svelte-e4c16403.js:4121:23: error: Big integer literals are not available in the configured target environment ("chrome61", "edge18", "es2019", "firefox60", "safari11")
pages\players\index.svelte-e4c16403.js:4160:23: error: Big integer literals are not available in the configured target environment ("chrome61", "edge18", "es2019", "firefox60", "safari11")
Error: Transform failed with 2 errors:
pages\players\index.svelte-e4c16403.js:4121:23: error: Big integer literals are not available in the configured target environment ("chrome61", "edge18", "es2019", "firefox60", "safari11")
pages\players\index.svelte-e4c16403.js:4160:23: error: Big integer literals are not available in the configured target environment ("chrome61", "edge18", "es2019", "firefox60", "safari11")
    at failureErrorWithLog (C:\kit\node_modules\esbuild\lib\main.js:1224:15)
    at C:\kit\node_modules\esbuild\lib\main.js:1072:33
    at C:\kit\node_modules\esbuild\lib\main.js:568:9
    at handleIncomingPacket (C:\kit\node_modules\esbuild\lib\main.js:657:9)
    at Socket.readFromStdout (C:\kit\node_modules\esbuild\lib\main.js:535:7)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

Information about your SvelteKit Installation:

Diagnostics

System: OS: Windows 10 10.0.19042 Binaries: Node: 14.16.0 - C:\Program Files\nodejs\node.EXE npm: 7.8.0 - C:\Program Files\nodejs\npm.CMD npmPackages: @sveltejs/kit: 1.0.0-next.70 => 1.0.0-next.70 svelte: 3.37.0 => 3.37.0 vite: 2.1.5 => 2.1.5

  • Your adapter: static

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

40reactions
bluwycommented, Jul 14, 2022

You can set optimizeDeps.esbuildOptions.target: 'es2020' and build.target: 'es2020' in the vite config to fix the issue (i believe)

6reactions
bginscommented, Aug 6, 2021

Hello 👋. I’ve run into this issue and the recommended solution doesn’t appear to be an option.

When I add

vite: () => ({
    build: {
        target: [ 'es2020' ]
    }
})

to kit in svelte.conifg.js and run npm run build (i.e. svelte-kit build), I get the message:

build_server: The value for kit.vite.build.target specified in svelte.config.js has been ignored. This option is controlled by SvelteKit.

Reading around a bit in the Discord channel and in other issues, it sounds like SveleKit targets es2019 with es2020 lib support. Is there a configuration that will allow for the use of Big integer literals?

I am testing this with the template app recommended on the SvelteKit homepage with TypeScript enabled. I’ve set the tsconfig.json target to es2020 in case there was some interaction there that might be problematic.

My use case would work fine with adapter-static if there is some way that the adapter might help here.


Please let me know if I can fill in any additional details or if I should open a new issue on this. Thanks! 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

BigInt | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
Launching the Browser Parts of the Browser
Launching the Browser. To access the Internet, you will need to open or “launch” the browser. To do so, click on the icon...
Read more >
big integer literals are not available in the configured ... - 掘金
big integer literals are not available in the configured target environment ( es2017 )技术、学习、经验文章掘金开发者社区搜索结果。掘金是一个帮助开发者成长的 ...
Read more >
Configure your browser for Figma
From the Start menu select Settings > Updates & Security. Select Windows updates at the top of the list and then Check for...
Read more >
Google Chrome and Mozilla Firefox version 100 could break ...
Much like the infamous Y2K bug that made the year 2000 indistinguishable from 1900 for some computers, browsers have different formats for user- ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found