Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Svelte REPL not starting ('defaultExtensions' is not exported) #4144

Open
1 of 2 tasks
mmailaender opened this issue Jun 21, 2023 · 1 comment
Open
1 of 2 tasks
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug

Comments

@mmailaender
Copy link
Contributor

mmailaender commented Jun 21, 2023

Which packages did you experience the bug in?

Tiptap Svelte REPL

What Tiptap version are you using?

2.0.3

What’s the bug you are facing?

Tried to run the Svelte REPL linked on this page: https://tiptap.dev/installation/svelte#take-a-shortcut-svelte-repl-with-tiptap

After starting I get the error 'defaultExtensions' is not exported by https://unpkg.com/@tiptap/[email protected]/dist/index.js, imported by ./Editor.svelte
image

As a result, the editor will be not renderd.

What browser are you using?

Chrome

Code example

https://svelte.dev/repl/798f1b81b9184780aca18d9a005487d2?version=3.31.2

What did you expect to happen?

No error - Instead the editor will be rendered

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@mmailaender mmailaender added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug labels Jun 21, 2023
@Prinzhorn
Copy link

Prinzhorn commented Apr 30, 2024

Here's the fixed version: https://svelte.dev/repl/7678261313034e2c996f96b3599ed4f6?version=4.2.15

<script type="module">
  import { onMount, onDestroy } from 'svelte'
  import { Editor } from '@tiptap/core'
-  import { defaultExtensions } from '@tiptap/starter-kit'
+  import StarterKit from '@tiptap/starter-kit'
	import BubbleMenu from '@tiptap/extension-bubble-menu'
	
	let bubbleMenu
  let element
  let editor

  onMount(() => {
    editor = new Editor({
      element: element,
      extensions: [
-				...defaultExtensions(),
+				StarterKit,
				BubbleMenu.configure({
		      element: bubbleMenu,
    		}),
			],
      content: `
				<h1>Hello Svelte! 🌍️ </h1>
				<p>This editor is running in Svelte.</p>
				<p>Select some text to see the bubble menu popping up.</p>
			`,
      onTransaction: () => {
        // force re-render so `editor.isActive` works as expected
        editor = editor
      },
    })
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Triage open
Development

No branches or pull requests

4 participants