2 Commits
Author SHA1 Message Date
Lauri Ojansivu e1f842eb56 Prevent Rspack development watchers exhausting the heap.
Long-running meteor run sessions repeatedly rebuild WeKan's large Blaze module graph. Rspack 1.x's experimental persistent cache retains JavaScript-side serialization state across those rebuilds and can eventually consume the full 16 GB V8 heap.

Disable both cache layers only for watch-mode runs. Short-lived production builds keep their persistent cache, and unrelated Rspack experiments continue to merge normally.

Focused configuration coverage checks client and server watchers, the production negative case, and merging over Meteor's cache defaults.

Thanks to xet7 !
2026-08-18 22:42:33 +03:00
Lauri Ojansivu 1551e142ff Dev server: stop the error overlay covering the app for cross-origin "Script error.".
On iPad Safari the full-screen "Uncaught runtime errors: ERROR Script error."
panel appeared after login and again when the Safari Share sheet was opened on
All Boards to add WeKan to the home screen.

That panel is webpack-dev-server's error overlay, shipped by the rspack DEV
server (the stack frames are in /__rspack__/client-rspack.js, a path that only
exists when isDevEnvironment; a production build has no dev server and no overlay
at all). Its catchRuntimeError handler opens the overlay for every window 'error'
event, including ones that carry no information: a browser sanitises an error
thrown by a CROSS-ORIGIN script to the bare message "Script error." with a null
error object and no stack, and iOS Safari raises those from its own machinery and
from content blockers / extensions - which is why opening the Share sheet
triggered it.

Such an error cannot come from WeKan's own code: the bundle is served same-origin
(WeKan sets no CDN_URL), so a real WeKan error always reaches the overlay with
its actual message and stack, and WeKan registers no visibilitychange / pagehide
/ blur handlers that the Share sheet could run. There is nothing to act on in
"Script error.", so the overlay now ignores exactly that message and keeps
showing every other runtime error, plus all compile errors, as before.

devServer.client.overlay.runtimeErrors takes an (error) => boolean filter that
webpack-dev-server serialises with toString() and rebuilds in the browser with
new Function(), so the filter is self-contained.

Tests: tests/devOverlayRuntimeErrors.test.cjs round-trips the filter exactly the
way the dev server does (encodeURIComponent(fn.toString()) -> new Function),
checks real errors still open the overlay and malformed input never throws, that
devServer stays out of production/server configs, and - because the base config
puts devServer.client.webSocketURL there on a remote ROOT_URL - that the merge
deep-merges instead of dropping the WebSocket URL.

Thanks to xet7 !
2026-07-25 00:08:56 +03:00