Add new strategies (E-H) to locate sqlite.worker.js in webpack configuration
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Successful in 7m39s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Successful in 7m48s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 2m1s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 1m50s

This commit is contained in:
2026-03-16 20:56:38 +01:00
parent dc2f2118f2
commit 04f8f2aae1
@@ -58,6 +58,14 @@ const pathB = path.resolve(process.cwd(), '../../core/local-db/src/jsMain/resour
const pathC = path.resolve(__dirname, '../../../../core/local-db/src/jsMain/resources/sqlite.worker.js');
// Strategy D: From processedResources of local-db module (Kotlin/JS build output)
const pathD = path.resolve(__dirname, '../../../../core/local-db/build/processedResources/js/main/sqlite.worker.js');
// Strategy E: Via process.cwd() 4 levels up = project root (works when Webpack runs from build/js/packages/<module>/)
const pathE = path.resolve(process.cwd(), '../../../../frontend/core/local-db/src/jsMain/resources/sqlite.worker.js');
// Strategy F: processedResources via process.cwd() 4 levels up
const pathF = path.resolve(process.cwd(), '../../../../frontend/core/local-db/build/processedResources/js/main/sqlite.worker.js');
// Strategy G: Via process.cwd() when Gradle runs from project root
const pathG = path.resolve(process.cwd(), 'frontend/core/local-db/src/jsMain/resources/sqlite.worker.js');
// Strategy H: processedResources via process.cwd() from project root
const pathH = path.resolve(process.cwd(), 'frontend/core/local-db/build/processedResources/js/main/sqlite.worker.js');
let workerSourcePath = null;
@@ -73,12 +81,28 @@ if (fs.existsSync(pathA)) {
} else if (fs.existsSync(pathD)) {
workerSourcePath = pathD;
console.log("Found sqlite.worker.js at (Strategy D - processedResources):", pathD);
} else if (fs.existsSync(pathE)) {
workerSourcePath = pathE;
console.log("Found sqlite.worker.js at (Strategy E - build dir relative):", pathE);
} else if (fs.existsSync(pathF)) {
workerSourcePath = pathF;
console.log("Found sqlite.worker.js at (Strategy F - build dir processedResources):", pathF);
} else if (fs.existsSync(pathG)) {
workerSourcePath = pathG;
console.log("Found sqlite.worker.js at (Strategy G - cwd project root):", pathG);
} else if (fs.existsSync(pathH)) {
workerSourcePath = pathH;
console.log("Found sqlite.worker.js at (Strategy H - cwd project root processedResources):", pathH);
} else {
console.error("ERROR: Could not find sqlite.worker.js in any expected location!");
console.error("Checked A:", pathA);
console.error("Checked B:", pathB);
console.error("Checked C:", pathC);
console.error("Checked D:", pathD);
console.error("Checked E:", pathE);
console.error("Checked F:", pathF);
console.error("Checked G:", pathG);
console.error("Checked H:", pathH);
}
if (workerSourcePath) {