You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting this error when trying to use the tiptap package:
Type error: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@tiptap/react")' call instead.
I can't convert my project to type "module". Any work around for this?
I faced a similar issue with another library but I fixed it by using these compilerOptions in tsconfig:
"module": "esnext", "moduleResolution": "Node",
but the same fix is not working for tip tap.
This is how my import statements look like though:
import { useEditor, EditorContent, BubbleMenu } from "@tiptap/react"; import { Heading } from "@tiptap/extension-heading"; import { BulletList } from "@tiptap/extension-bullet-list"; import { ListItem } from "@tiptap/extension-list-item"; import { OrderedList } from "@tiptap/extension-ordered-list"; import { StarterKit } from "@tiptap/starter-kit";
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm getting this error when trying to use the tiptap package:
Type error: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@tiptap/react")' call instead.
I can't convert my project to type "module". Any work around for this?
I faced a similar issue with another library but I fixed it by using these
compilerOptions
in tsconfig:"module": "esnext", "moduleResolution": "Node",
but the same fix is not working for tip tap.
This is how my import statements look like though:
import { useEditor, EditorContent, BubbleMenu } from "@tiptap/react"; import { Heading } from "@tiptap/extension-heading"; import { BulletList } from "@tiptap/extension-bullet-list"; import { ListItem } from "@tiptap/extension-list-item"; import { OrderedList } from "@tiptap/extension-ordered-list"; import { StarterKit } from "@tiptap/starter-kit";
Beta Was this translation helpful? Give feedback.
All reactions