-
Notifications
You must be signed in to change notification settings - Fork 168
Open
Description
What happens?
Using react to instantiate duckdb, I pass in a basic InstantiationProgressHandler that logs to console. The output is below.
{startedAt: Mon Aug 04 2025 07:51:54 GMT+0100 (British Summer Time), updatedAt: Mon Aug 04 2025 07:51:54 GMT+0100 (British Summer Time), bytesTotal: 6285550, bytesLoaded: 9314009}
{startedAt: Mon Aug 04 2025 07:51:54 GMT+0100 (British Summer Time), updatedAt: Mon Aug 04 2025 07:51:54 GMT+0100 (British Summer Time), bytesTotal: 6285550, bytesLoaded: 9325068}
....
{startedAt: Mon Aug 04 2025 07:51:54 GMT+0100 (British Summer Time), updatedAt: Mon Aug 04 2025 07:51:54 GMT+0100 (British Summer Time), bytesTotal: 6285550, bytesLoaded: 32599231}
{startedAt: Mon Aug 04 2025 07:51:54 GMT+0100 (British Summer Time), updatedAt: Mon Aug 04 2025 07:51:54 GMT+0100 (British Summer Time), bytesTotal: 6285550, bytesLoaded: 32628187}Should bytesLoaded be greater than bytesTotal? It's a small bug, but it means I can't display a trustworthy progress bar.
To Reproduce
I think I'm using standard instantiation code:
const bundles = getJsDelivrBundles()
const bundle = await selectBundle(bundles)
const progressHandler = (progress: InstantiationProgress) => {
console.log(progress)
}
const workerUrl = URL.createObjectURL(
new Blob([`importScripts("${bundle.mainWorker!}");`], {
type: 'text/javascript',
})
)
const worker = new Worker(workerUrl)
const db = new AsyncDuckDB(new ConsoleLogger(LogLevel.DEBUG), worker)
await db.instantiate(bundle.mainModule, bundle.pthreadWorker, progressHandler)
URL.revokeObjectURL(workerUrl)Browser/Environment:
Vite and NextJS on Chrome
Device:
macbook pro laptop
DuckDB-Wasm Version:
1.29.1-dev132.0
DuckDB-Wasm Deployment:
local machine
Full Name:
Jayshan Raghunandan
Affiliation:
None
Metadata
Metadata
Assignees
Labels
No labels