fix(runtime): isolate unique 8177 repairs (#8298)

This commit is contained in:
backryun
2026-07-24 21:35:10 +09:00
committed by GitHub
parent 0b68fd353f
commit b84f86ad4f
6 changed files with 22 additions and 18 deletions

View File

@@ -31,18 +31,6 @@ function resolveSqlJsWasmPath(): string {
const sqlJsEntry = _require.resolve("sql.js");
candidatePaths.push(path.join(path.dirname(sqlJsEntry), "sql-wasm.wasm"));
} catch {}
// #8135: Use a dynamic expression to avoid Next.js bundler's static analysis
// producing a "Can't resolve 'sql.js/package.json'" build warning. The package.json
// resolution is only needed for the WASM path, and the try/catch is still required
// at runtime since sql.js is an optional dependency.
try {
const pkgName = "sql.js" + "/package.json";
const sqlJsPackage = _require.resolve(pkgName);
candidatePaths.push(
path.join(path.dirname(sqlJsPackage), "dist", "sql-wasm.wasm"),
path.join(path.dirname(sqlJsPackage), "sql-wasm.wasm")
);
} catch {}
for (const candidatePath of candidatePaths) {
if (fs.existsSync(candidatePath)) {