Description
Bug Report
Describe the bug
When upgrading BlockNote from version v0.15.1
to v0.15.2
, dynamic chunks fail to load properly in an environment that uses Vite Module Federation. The result is multiple 404 Not Found errors when the remote module attempts to fetch the chunks (index-[hash].js
).
What puzzles me most is that this error only occurs when the remote module is loaded for the first time.
To Reproduce
-
Setup a Vite Module Federation project with the following remote configuration:
federation({ name: 'frontend', filename: 'remoteEntry.js', remotes: { blockEditor: 'http://localhost:3478/assets/remoteEntry.js', }, });
-
In the consumer project, dynamically import a BlockNote component:
const blockNotesMount = await import('blockEditor/BlockNotes');
-
Run both the remote (form-builder) and host (frontend) applications.
-
Observe the console logs and network tab in the browser.
Expected behavior
The chunks (index-[hash].js
) should be loaded properly without returning 404 Not Found errors.
Actual behavior
404 errors occur when the remote tries to fetch the dynamically generated chunks.
Error Example in Console:
GET http://localhost:8080/assets/index-B0aq7g5R.js 404 (Not Found)
Misc
- Node version: 20.15.0
- Package manager: npm 10.7.0
- Browser: Chrome 131
- BlockNote version: v0.15.2
- Vite: 6.0.3
- Vite Plugin Federation: @originjs/vite-plugin-federation v1.3.6
Additional Context
The issue does not occur in version v0.15.1
of BlockNote. It appears that changes in v0.15.2
(notably PRs #943 and #945) related to drag-and-drop and module management have affected compatibility with Vite's dynamic imports.
Downgrading to v0.15.1
resolves the issue temporarily:
npm install @blocknote/[email protected] @blocknote/[email protected]