Issue with BubbleMenu (in React) "tippy_js_WEBPACK_IMPORTED_MODULE_@__ is not a function" #6099
Unanswered
MemorySounds
asked this question in
Questions & Help
Replies: 2 comments
-
There appears to be an issue in 2.11.5 causing this. We had to lock our version to 2.11.3 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm having the same problem with the FloatingMenu with a very basic setup, but locking all the tiptap versions to 2.11.3 did not fix the issue. SymptomsI'm trying to integrate Tiptap with the Floating Menu plugin into my React app, and every time I click into the editor, if I'm trying to use the Floating Menu, I get the following error:
Versions
I've tried
My code<TiptapEditor
content="Preview content"
className="text-sm rounded-xl bg-secondary-light border-secondary-light py-3 px-4 w-full"
/> TiptapEditor.tsx: import React from 'react';
import StarterKit from '@tiptap/starter-kit';
import { EditorContent, useEditor } from '@tiptap/react';
import VariableToolbar from './VariableToolbar';
type Props = {
className?: string,
content: string,
}
const TiptapEditor = ({
className,
content,
}: Props) => {
const editor = useEditor({
extensions: [StarterKit],
content,
});
if (!editor) {
return null;
}
return (
<div className={className}>
<VariableToolbar editor={editor} />
<EditorContent editor={editor} />
</div>
);
};
export default TiptapEditor; VariableToolbar.tsx: import React, { useState } from 'react';
import { PlusIcon } from '@heroicons/react/outline';
import { FloatingMenu, Editor } from '@tiptap/react';
import Button from 'components/Button';
type Props = {
editor: Editor
}
const VariableToolbar = ({ editor }: Props) => {
const [showDropdown, setShowDropdown] = useState(false);
if (!editor) {
return null;
}
const variableOptions = [
{ label: 'Student first name', id: '{{student_first_name}}' },
{ label: 'Student last name', id: '{{student_last_name}}' },
{ label: 'Absence count', id: '{{absence_count}}' },
];
return (
<FloatingMenu editor={editor}>
<div className="flex flex-row justify-end mt-2 relative">
<Button
icon={PlusIcon}
aria-label="Insert variable"
onClick={() => setShowDropdown(!showDropdown)}
className="p-2"
/>
{showDropdown && (
<div className="absolute rounded-lg p-1 border top-0 right-0 mt-10 bg-white shadow flex flex-col">
{variableOptions.map(({ id, label }) => (
<button
type="button"
key={id}
onClick={() => {
editor.chain().focus().insertContent(id).run();
setShowDropdown(false);
}}
className="text-xs p-[.2rem] w-full text-left hover:bg-secondary-light"
>
{label}
</button>
))}
</div>
)}
</div>
</FloatingMenu>
);
};
export default VariableToolbar; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi TipTap team,
I am encountering an issue with the BubbleMenu Extension component. When I try to use it in my project, I get the following error:
I've tried all kinds of configurations, direct imports, etc. I can't seem to make the BubbleMenu (same for FloatingMenu actually) to pick-up the tippy.
Here's the relevant code
As you can see, it's a pretty basic setup, so not sure where I am going wrong. If anyone has some advice I'd be very grateful.
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions