porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.37k stars 267 forks source link

Get Error Big integer literals are not available in the configured target environment #374

Closed Sylor-huang closed 2 years ago

Sylor-huang commented 2 years ago

I use vite to create a project in local

But when I start project, I get the error: Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2019", "firefox78", "safari13.1")

[vite] error while updating dependencies:
Error: Build failed with 2 errors:
node_modules/postgres/src/connection.js:346:91: ERROR: Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2019", "firefox78", "safari13.1")
node_modules/postgres/src/connection.js:433:50: ERROR: Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2019", "firefox78", "safari13.1")
    at failureErrorWithLog (/Users/mac/MyCodes/swap_bot/node_modules/esbuild/lib/main.js:1603:15)
    at /Users/mac/MyCodes/swap_bot/node_modules/esbuild/lib/main.js:1249:28
    at runOnEndCallbacks (/Users/mac/MyCodes/swap_bot/node_modules/esbuild/lib/main.js:1034:63)
    at buildResponseToResult (/Users/mac/MyCodes/swap_bot/node_modules/esbuild/lib/main.js:1247:7)
    at /Users/mac/MyCodes/swap_bot/node_modules/esbuild/lib/main.js:1356:14
    at /Users/mac/MyCodes/swap_bot/node_modules/esbuild/lib/main.js:666:9
    at handleIncomingPacket (/Users/mac/MyCodes/swap_bot/node_modules/esbuild/lib/main.js:763:9)
    at Socket.readFromStdout (/Users/mac/MyCodes/swap_bot/node_modules/esbuild/lib/main.js:632:7)
    at Socket.emit (node:events:520:28)
    at addChunk (node:internal/streams/readable:315:12)

https://github.com/sveltejs/kit/issues/859#issuecomment-894556133

Could you please give me some suggestions for modification? Thanks so much

e3dio commented 2 years ago

This library is for Node.js/Deno not browsers. You should ask for help in "vite" forum on how to use it, not here

Sylor-huang commented 2 years ago

ok

PierBover commented 2 years ago

Yeah this is a Vite error. You will need to exclude the dependency from being processed by Vite:

https://vitejs.dev/config/#optimizedeps-exclude