Skip to content

Commit 27f3710

Browse files
ntdatt812decolua
authored andcommitted
fix(docker): ship sql.js so the pure-JS DB fallback can start
Next file tracing follows JS imports, and sql.js loads dist/sql-wasm.wasm by path at runtime, so the standalone output carries the package's JS without its wasm binary. When both native drivers fail the last-resort adapter then aborts with ENOENT on the missing binary and the container never gets a database. The CLI bundle already guards this explicitly (build-cli.js step 3b, ensureModuleInBundle("sql.js")); the image just never got the same treatment. Copy the package the same way node-forge and next already are. Fixes #3248
1 parent 59d858b commit 27f3710

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Dockerfile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ COPY --from=builder /app/src/mitm ./src/mitm
3737
COPY --from=builder /app/node_modules/node-forge ./node_modules/node-forge
3838
# Ensure `next` is available at runtime in case tracing did not include it.
3939
COPY --from=builder /app/node_modules/next ./node_modules/next
40+
# sql.js loads dist/sql-wasm.wasm by path at runtime; tracing only follows JS imports,
41+
# so the last-resort DB driver would abort with ENOENT on the missing binary.
42+
COPY --from=builder /app/node_modules/sql.js ./node_modules/sql.js
4043

4144
RUN mkdir -p /app/data && chown -R node:node /app && \
4245
mkdir -p /app/data-home && chown node:node /app/data-home && \

0 commit comments

Comments
 (0)