-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
(NextJS on M1 OSX) Reference error: Navigator not defined #132
Comments
Tried it on a brand new next app using create-next-app and was able to reproduce this error. Tried main repo and running the example and I am not getting the error. In the next app I have also disabled ssr on the page this is loading using dynamic still getting this error. So looks like next specific error. |
packages/core/src/shared/utils.ts
|
Running into this error as well using Next.js 13 App Router. Will investigate! |
Update: Still stuck on this – looks like importing with
|
Does this work for you?
import "@blocknote/core/style.css";
import { BlockNoteView, useBlockNote } from "@blocknote/react";
function Editor() {
const editor = useBlockNote({});
return <BlockNoteView editor={editor} />;
}
export default Editor;
// top of file
const BlockNote = dynamic(() => import("./DynamicBlockNote"), {
ssr: false,
});
...
// in your render() function:
<div style={{ width: "500px;height:300px;background:white" }}>
<BlockNote />
</div> |
I tried this. It doesn't solve the problem. |
Yeah same - dynamically importing from |
This demo works for me: https://github.com/YousefED/blocknote-examples-nextjs/pull/1 Are you using NPM or a different package manager? |
Ooooh this |
Next.js completely broken due to the navigator error. Any fix coming? @YousefED ? |
Have you tried the version / demo above? Are you still encountering issues? |
I'm closing this issue as I think NextJS should be fixed as part of |
Unfortunately, I have the same issue:
BlockNode: 0.5.0 |
@Kay2dan could you share a reproducible sandbox / repo? |
Yes sure, however, can you give me a day or two to get to it.
|
I just installed 0.5.0 in combination with |
Are you using npm / pnpm / yarn? Which version?
…On Fri, 31 Mar 2023 at 08:45, Adam ***@***.***> wrote:
I just installed 0.5.0 in combination with "next": "13.1.2", and also
getting this error.
—
Reply to this email directly, view it on GitHub
<#132 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC2BWKDTHYURJFZEPHOQU3W6Z4SHANCNFSM6AAAAAAV3NKPRM>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I'm using |
Fyi, nextjs should work more straightforward as part of v0.5.1: https://github.com/TypeCellOS/BlockNote/releases/tag/v0.5.1. |
0.5.1 fixed the issue completely for me (without dynamic imports). Thank you! |
Firstly love the implementation and would love to contribute to make it better.
I am using nextJS on macOS with the following configuration file.
If I try to refresh the page from the browser, I am getting the following error.
The text was updated successfully, but these errors were encountered: