mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
After the mongodb/bson 7.3.0 bump, opening any board rendered nothing. bson 7.x
evaluates, at module-load time:
const { startupSnapshot } = globalThis?.process?.getBuiltinModule('v8') ?? {};
The optional chaining stops before the call, so in the browser (partial
`process` polyfill, no getBuiltinModule) it throws
`TypeError: getBuiltinModule is not a function` while evaluating
client/components/cards/attachments.js (`import { ObjectId } from 'bson'`). That
aborts the client bundle bootstrap partway through client/imports.js, so every
feature imported after it (notifications, swimlanes, rules, ...) is never
registered and the board view dies with `No such template: notifications`.
- Add client/lib/bsonBrowserShim.js (imported first in client/main.js) that
installs a no-op process.getBuiltinModule in the browser, so bson takes its
intended `?? {}` fallback (there is no V8 startup snapshot in a browser).
- Add unit tests (client/lib/tests/bsonBrowserShim.tests.js), 6 cases.
- Harden the #5686 Playwright spec (specs/34) to actually exercise the gesture
now that boards render: select real checklist text and fire the real outside
click; DOM-aware "outside the card" point for the control case.
- Update CHANGELOG upcoming.
Verified against a running instance: boards render again, Template.notifications
is registered, specs 34 and 35 pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
22 lines
891 B
JavaScript
22 lines
891 B
JavaScript
// ============================================================================
|
|
// WeKan Client Entry Point
|
|
//
|
|
// Side-effect imports keep bootstrap order explicit without relying on
|
|
// browser-side CommonJS require().
|
|
// ============================================================================
|
|
|
|
// 0. Browser shim that MUST run before any module pulls in bson: bson 7.x calls
|
|
// `process.getBuiltinModule('v8')` at load time, which throws in the browser
|
|
// (partial `process` polyfill) and aborts the bundle bootstrap, leaving later
|
|
// features (notifications, swimlanes, …) unregistered so boards do not render.
|
|
import '/client/lib/bsonBrowserShim';
|
|
|
|
// 1. Bootstrap — helpers polyfill (SimpleSchema is server-only)
|
|
import '/imports/collectionHelpers';
|
|
|
|
// 2. Eagerly load all app styles
|
|
import '/client/styles';
|
|
|
|
// 3. Load all application code
|
|
import '/client/imports';
|