Open derekjwilliams opened 1 week ago
Fix: in src/components/Editor.tsx, change
import { BlockNoteView, useCreateBlockNote } from '@blocknote/react'
to
import { BlockNoteViewRaw, useCreateBlockNote } from '@blocknote/react'
It looks like BlockNoteVew should come from @blocknote/mantine
e.g.
import { BlockNoteView } from '@blocknote/mantine'
import { useCreateBlockNote } from '@blocknote/react'
make sure to install @blocknote/mantine, e.g. npm install @blocknote/mantine (not sure if this would work with shadcn, or ariakit (e.g. @blocknote/shadcn, @blocknote/ariakit)
Let me know if you'd like a PR for these changes, still going through your video, so there could be others related to the upgrade to the latest blocknote.
We love breaking changes :)
Thanks @derekjwilliams for hunting this down. Feel free to make a PR once you go through the whole video to confirm any other changes you find.
Would prefer if we're able to keep the imported objects the same (e.g., sticking to BlockNoteView
with a different import path instead of switching to BlockNoteViewRaw
) to maintain consistency with the tutorial.
When I updated to the latest versions of @blocknote/core and @blocknote/react (0.14.5 and 0.14.5), I get errors, e.g. in the terminal
Attempted import error: 'BlockNoteView' is not exported from '@blocknote/react' (imported as 'BlockNoteView').
and in the browser Error:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of 'Editor'.
I have not modified the source and it runs correctly with a fresh clone and install, so it looks like there were some breaking changes in @blocknote/core or @blocknote/react. Investigating and will post my findings here.
Here is my package.json