steven-tey / novel

Notion-style WYSIWYG editor with AI-powered autocompletion.
https://novel.sh
Apache License 2.0
12.21k stars 1.02k forks source link

bug: Runtime Error with Invalid Element Type in Next.js 14 Project Using Novel.sh #303

Open ajagatobby opened 6 months ago

ajagatobby commented 6 months ago

Provide environment information

System: OS: macOS 13.5 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 994.20 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 21.3.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.4 - /usr/local/bin/npm

Describe the bug

I encountered a runtime error in my Next.js project using the Novel.sh editor.

Screenshot 2024-02-19 at 11 56 05 PM

The error message is as follows: 'Unhandled Runtime Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.' This issue seems to suggest a problem with component exports or imports

Link to reproduction

I don't have it deployed

To reproduce

  1. Create next app using latest -v
  2. Import Editor from novel `js

"use client";

import { Editor } from "novel";

export default function Home() { return (

); }

`

Additional information

No response

ajagatobby commented 6 months ago

I just discovered downgrading to 0.1.21 works fine.

axgalache commented 5 months ago

I am having the very same issue on NextJS 14.1.0 (novel 0.2.7). Any feedback? (I think downgrading novel so much is not a good idea by far)