Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlockNote v0.15.2 Incompatibility with Vite Module Federation: 404 Errors on Dynamic Chunk Loading #1330

Open
GersonDantas opened this issue Dec 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@GersonDantas
Copy link

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).
Captura de Tela 2024-12-18 às 11 52 24

What puzzles me most is that this error only occurs when the remote module is loaded for the first time.


To Reproduce

  1. 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',
      },
    });
  2. In the consumer project, dynamically import a BlockNote component:

    const blockNotesMount = await import('blockEditor/BlockNotes');
  3. Run both the remote (form-builder) and host (frontend) applications.

  4. 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]
@GersonDantas GersonDantas added the bug Something isn't working label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant