question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot use in SvelteKit

See original GitHub issue

Hi Guys,

your bytemd looks very cool and I like to use it in a SvelteKit project. Unfortunately I cannot make it work. I get that error :

The requested module '/node_modules/.pnpm/rehype-raw@5.1.0/node_modules/rehype-raw/index.js?v=5165e040' does not provide an export named 'default'
SyntaxError: The requested module '/node_modules/.pnpm/rehype-raw@5.1.0/node_modules/rehype-raw/index.js?v=5165e040' does not provide an export named 'default'

Any idea how to resolve that. I tried the suggested setup.

<script>
  import { Editor, Viewer } from 'bytemd';
  import gfm from '@bytemd/plugin-gfm';

  let value;
  const plugins = [
    gfm(),
    // Add more plugins here
  ];

  function handleChange(e) {
    value = e.detail.value;
  }
</script>

<template>
  <Editor {value} {plugins} on:change={handleChange} />
</template>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
benmccanncommented, Mar 1, 2022

There’s a few different issues involved. I posted a summary on the other issue. See here: https://github.com/bytedance/bytemd/issues/96#issuecomment-1054538106

0reactions
pd4d10commented, Mar 26, 2022

Duplicate of #96

Let’s track it there

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors • Docs • SvelteKit
SvelteKit handles errors differently depending on where they occur, what kind of errors they are, and the nature of the incoming request.
Read more >
SvelteKit v1.0.0-next.146 SyntaxError: Cannot use import ...
The error: Cannot use import statement outside a module in vscode. create-svelte version 2.0.0-next.78 Welcome to SvelteKit! This is beta ...
Read more >
SvelteKit $app cannot be found in svelte.config.js
Great question. The solution is this, you cannot use the $app inside the config file if you would ever need the environment you...
Read more >
Deploy a Svelte site · Cloudflare Pages docs
Since the environment variables are not set, you cannot use Cloudflare Pages features, like Direct Uploads or Functions, locally.
Read more >
Svelte-Kit Dev Is No Longer Available Use Vite Dev Instead
Your browser can't play this video. Learn more. Switch camera.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found