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
bundle: {
mainModule: '/home/runner/work/duckdb-wasm-npm-link/duckdb-wasm-npm-link/node_modules/@duckdb/duckdb-wasm/dist/duckdb-eh.wasm',
mainWorker: '/home/runner/work/duckdb-wasm-npm-link/duckdb-wasm-npm-link/node_modules/@duckdb/duckdb-wasm/dist/duckdb-node-eh.worker.cjs',
pthreadWorker: null
}
instantiating db
worker terminated with 1 pending requests
⚠ Restarted static page generation for / because it took more than 60 seconds
FROM node:19.3.0
COPY . /src
# ✅ Build succeeds with local duckdb-utils installRUN cd /src/duckdb-utils/dist && npm i
WORKDIR /src
RUN npm i
# This fails in Github Actions, but not in this Docker build, or on the underlying host, on my M1 macbook or an Amazon Linux EC2 instanceRUN npm run build
# ❌ Build fails with `npm link`ed duckdb-utilsRUN cd /src/duckdb-utils/dist && npm link
RUN npm link duckdb-utils
RUN npm run build # ❌ `worker terminated with 1 pending requests` inside AsyncDuckDB constructor
All the repros I've found involve Next.js, but the fact that the failure occurs within duckdb-wasm, and manifests as a hang instead of a normal Error / exception, makes me feel like it may be primarily a duckdb-wasm problem. I have only tried to use duckdb-wasm within Next.js, so I'm not sure it's specific to Next.
Will try to add more details later but 2 things that seem to help:
Skip this npm i in the Dockerfile:
-RUN cd /src/duckdb-utils/dist && npm i+RUN cd /src/duckdb-utils/dist
Make sure web-worker is in the dependencies array of the outer package (this was already the case in my repro, but I ran into it in another project today).
What happens?
In some situations,
AsyncDuckDB.instantiate
emits this error and hangsnext build
:I've run into this a few times while trying to use duckdb-wasm in Next.js apps. Here's some repro info (copied from runsascoded/duckdb-wasm-issue):
Repro
duckdb-utils/src/duckdb.ts calls
AsyncDuckDB.instantiate
:Github Actions repro
Here's an example of the error in a Github Action:
Dockerfile repro
For some reason, the error only happens in this Dockerfile when the duckdb-utils module is
npm link
ed:Clone +
docker build
Clone this repo, and build the Dockerfile:
I observe the same
docker build
failure on my M1 macbook and an Amazon Linux instance I tested.Host repro
I also see the same failure when running directly on each underlying host (macbook / AZLinux), without Docker:
npm run build
succeeds whenduckdb-utils
isnpm install
ed directly.npm run build
fails whenduckdb-utils
isnpm link
ed.I don't know why Github Actions'
ubuntu-latest
demonstrates the problem more easily (without thenpm link
step).Earlier repro: next.js#57819
I previously filed a repro at next.js#57819.
All the repros I've found involve Next.js, but the fact that the failure occurs within duckdb-wasm, and manifests as a hang instead of a normal
Error
/ exception, makes me feel like it may be primarily a duckdb-wasm problem. I have only tried to use duckdb-wasm within Next.js, so I'm not sure it's specific to Next.To Reproduce
Browser/Environment:
Node v19.3.0
Device:
M1 macbook, Amazon Linux, Github Actions ubuntu-latest
DuckDB-Wasm Version:
1.28.0
DuckDB-Wasm Deployment:
@duckdb/duckdb-wasm/dist/duckdb-eh.wasm
Full Name:
Ryan Williams
Affiliation:
Runs As Coded LLC
The text was updated successfully, but these errors were encountered: