#66381·Node.js

sqlite3 can NOT handle big number: [ Value is too large to be represented as a JavaScript number: 13435075631098976]

Author: navegador5Created Sep 28, 2026Updated Sep 28, 2026

Version

Welcome to Node.js v26.2.0.

Platform

Microsoft Windows NT 10.0.26200.0 x64

Subsystem

No response

What steps will reproduce the bug?

Welcome to Node.js v26.2.0. Type ".help" for more information.

function exec_sql_once(dbpath, sql) { | const { DatabaseSync } = require('node:sqlite'); | const db = new DatabaseSync(dbpath, { readOnly: true }); | return db.prepare(sql).all(); | } undefined s='D:/FFMPEG-RTSP-CLIENT/rtsp-win-server/rtsp_server/PUBLISH/webvw/userDataFolder/EBWebView/Default/History' 'D:/FFMPEG-RTSP-CLIENT/rtsp-win-server/rtsp_server/PUBLISH/webvw/userDataFolder/EBWebView/Default/History' exec_sql_once(s,"SELECT * FROM urls;") Uncaught: RangeError: Value is too large to be represented as a JavaScript number: 13435075631098976 at exec_sql_once (REPL6:4:32) { code: 'ERR_OUT_OF_RANGE' }

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

to bigint OR string instead of 'ERR_OUT_OF_RANGE'

What do you see instead?

Uncaught: RangeError: Value is too large to be represented as a JavaScript number: 13435075631098976 at exec_sql_once (REPL6:4:32) { code: 'ERR_OUT_OF_RANGE' }

Additional information

No response