Cannot use in SvelteKit
See original GitHub issueHi 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:
- Created 2 years ago
- Reactions:8
- Comments:5 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
Duplicate of #96
Let’s track it there