Closed fabianmu closed 1 year ago
In watchmode I get when clicking into the editor to focus on it
TypeError
tippy_js__WEBPACK_IMPORTED_MODULE_2__ is not a function
Call Stack
BubbleMenuView.createTooltip
webpack-internal:///9353:661:22
BubbleMenuView.updateHandler
webpack-internal:///9353:608:18
BubbleMenuView.update
webpack-internal:///9353:683:18
eval
webpack-internal:///9353:584:35
The issue seems to be with the way Tippy.js is bundled (Tippy is a dependecy of "@tiptap/extension-bubble-menu") Strapi uses esbuild as a bundler, and it seems to think Tippy is an es6 compliant module (it is not).
For the moment i'm using this "fix" in the webpack config file for strapi:
config.plugins.push(new webpack.NormalModuleReplacementPlugin(
/^tippy\.js$/,
'tippy.js/dist/tippy-bundle.umd.min.js'
))
However this is not the ideal solution which I think should be:
I haven't opened an issue on Tippy.js or @tiptap/extension-bubble-menu though.
Same issue as #61 I think. @giu1io, how did you debug it to find out that it is Tippy.js? (wondering out of curiousity as I tried to debug it myself aswell)
Same issue as #61 I think. @giu1io, how did you debug it to find out that it is Tippy.js? (wondering out of curiousity as I tried to debug it myself aswell)
I've launched Strapi in --watch-admin
mode, that way you can debug the exact point in the code where the crash happens.
@giu1io is there any solution to this editor problem at this moment?
@giu1io is there any solution to this editor problem at this moment?
I'm using the solution that I detailed in my previous comment
The issue seems to be with the way Tippy.js is bundled (Tippy is a dependecy of "@tiptap/extension-bubble-menu") Strapi uses esbuild as a bundler, and it seems to think Tippy is an es6 compliant module (it is not).
For the moment i'm using this "fix" in the webpack config file for strapi:
config.plugins.push(new webpack.NormalModuleReplacementPlugin( /^tippy\.js$/, 'tippy.js/dist/tippy-bundle.umd.min.js' ))
However this is not the ideal solution which I think should be:
- make Tippy.js esModule compliant
- update the entire dependency tree
I haven't opened an issue on Tippy.js or @tiptap/extension-bubble-menu though.
I can also confirm that this completely fixes the issue!
I will update the readme to reflect this.
Strapi 4.6.1, tested also with 4.6.2 strapi-tiptap-editor": "0.9.10"
I can't add line breaks (return or shift + return) and the console shows errors on keydown.
See video
https://user-images.githubusercontent.com/89517/220761915-a5833afd-b9fc-4c82-a577-ec5232c9092e.mp4