BlockNote
BlockNote copied to clipboard
Unable to import from BlockNote packages when using `NodeNext` for `moduleResolution`.
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
- Open a project using BlockNote and update the
tsconfig.jsonto useNodeNextformoduleandmoduleResolution. - Restart the TS server if necessary and review errors
Misc
- Node version: v22.1.0
- Package manager: pnpm
- Browser: N/A
- [ ] I'm a sponsor and would appreciate if you could look into this sooner than later 💖
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)
Yes, this fixes it! Thank you for the quick response 🙏