ueberdosis / tiptap

The headless rich text editor framework for web artisans.
https://tiptap.dev
MIT License
26.6k stars 2.23k forks source link

[Bug]: Testing error when migrate @tiptap/vue-2 to @tiptap/vue-3 #4161

Closed maisasb closed 1 year ago

maisasb commented 1 year ago

Which packages did you experience the bug in?

@tiptap/vue-3

What Tiptap version are you using?

2.0.3

What’s the bug you are facing?

I am migrating Vue 2 (2.7.10) project to Vue 3 (3.3.4) and I installed the @tiptap/vue-3 (2.0.3) package, the component works fine but all tests are breaking with @testing-library/vue.

The error I am facing: image And we can't mock and do anything to pass the tests :/

What browser are you using?

Chrome

Code example

https://github.com/maisasb/tiptap-error

What did you expect to happen?

The tests pass and dont break in Editor constructor

Anything to add? (optional)

No response

Did you update your dependencies?

Are you sponsoring us?

guilhermebc commented 1 year ago

same here

will-lucena commented 1 year ago

+1

jaek-s commented 10 months ago

Is there any update on this? I noticed this issue is closed, but my team just ran into a similar issue. We're using the composition API and received this error: TypeError: (0 , _vue.useEditor) is not a function

uccmen commented 4 weeks ago

@maisasb I'm seeing this issue as well. Do you have any recommendation on what needs to be done to get the tests passing?

uccmen commented 4 weeks ago

@jaek-s were you able to resolve the issue?

nperez0111 commented 4 weeks ago

My guess would be CJS vs ESM imports

uccmen commented 4 weeks ago

@nperez0111 thanks for your input! I got it working with below for both runtime and testing:

import * as tiptap from '@tiptap/vue-3';
const { Editor, EditorContent, FloatingMenu, BubbleMenu } = tiptap;