TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
6.63k stars 457 forks source link

Unable to import from BlockNote packages when using `NodeNext` for `moduleResolution`. #952

Closed danielrearden closed 3 weeks ago

danielrearden commented 3 months ago

Describe the bug Using NodeNext as the moduleResolution value in a project's tsconfig.json breaks the ability to import from @blocknote/core, @blocknote/react and @blocknote/server-util. Any exports in those packages that use the export * from syntax are not importable and result in the error below.

Module '"@blocknote/react"' has no exported member 'Components'.ts(2305)

Mantine went through a similar issue here. The resolution there was to explicitly append the .js extension to the exports. However, I'm not 100% sure this wouldn't be a breaking change.

To Reproduce

Misc

YousefED commented 3 months ago

Thanks for reporting and attempting a fix @danielrearden . Could you see if https://github.com/TypeCellOS/BlockNote/pull/956 fixes the issue?

(you could copy over the built files to your project for example)

danielrearden commented 3 months ago

Yes, this fixes it! Thank you for the quick response 🙏