fix(subsUnion): force-bundle turf deps used only by the worker thread
Some checks failed
build-image / build (push) Has been cancelled

Meteor's build only includes npm packages it sees imported/required
somewhere in its own traced module graph. private/workers/unionWorker.js
is a plain asset (loaded at runtime via new Worker(), never
import/require'd from Meteor-compiled code), so @turf/circle,
@turf/union and @turf/truncate got silently dropped from
programs/server/node_modules — the worker crashed on every call with
"Cannot find module '@turf/circle'", which incrementalAdd/process
swallowed and stored as a "null" union (typeof null === 'object', so
the null-check that guards against failed unions doesn't catch it).
Side-effect imports here force Meteor to bundle them.
This commit is contained in:
vjrj 2026-07-30 08:27:40 +02:00
parent 110ad66e86
commit 4879d3482d

View file

@ -1,6 +1,16 @@
import path from 'path';
import { Worker } from 'worker_threads';
// Meteor only bundles the npm packages it sees imported/required somewhere in
// its own compiled module graph. The actual usage of these three is inside
// private/workers/unionWorker.js, a plain asset file Meteor's bundler never
// traces (it's loaded at runtime via new Worker(), not import/require here).
// Without this, `meteor build` drops them from programs/server/node_modules
// and the worker fails at startup with "Cannot find module '@turf/circle'".
import '@turf/circle';
import '@turf/union';
import '@turf/truncate';
const WORKER_PATH = path.resolve(process.cwd(), 'assets/app/workers/unionWorker.js');
/**