Skip to content

Docx exporter encounters error due to how it's importing buffer package #1675

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

Closed
richardvanbergen opened this issue May 10, 2025 · 0 comments · Fixed by #1677
Closed

Docx exporter encounters error due to how it's importing buffer package #1675

richardvanbergen opened this issue May 10, 2025 · 0 comments · Fixed by #1677
Labels
bug Something isn't working

Comments

@richardvanbergen
Copy link
Contributor

richardvanbergen commented May 10, 2025

Describe the bug
In the course of normal usage the call to toDocxJsDocument does not work with the following error:

@blocknote_xl-docx-e…r.js?v=258d18af:380 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'from')
    at async App.tsx:23:26

Seems to be that buffer package removed the named export recently. If change const Buffer = (await import("buffer")).default.Buffer; to const Buffer = (await import("buffer")).default; then it works correctly.

I will create a PR to fix shortly.

To Reproduce

  1. https://stackblitz.com/edit/github-7wt3cfcn?file=App.tsx
  2. Click the button at the top.
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

Successfully merging a pull request may close this issue.

1 participant