-
Notifications
You must be signed in to change notification settings - Fork 107
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
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '$$') #11
Comments
I have the same issue. I made an <script lang="ts">
import { Editor, Viewer } from 'bytemd'
import gfm from '@bytemd/plugin-gfm'
let value: string = "";
const plugins = [
gfm(),
// Add more plugins here
]
function handleChange(e) {
value = e.detail.value
}
</script>
<style type="text/css">
@import "bytemd/dist/index.css";
</style>
<template>
<Editor {value} {plugins} on:change={handleChange} />
</template> |
I dug a bit further on this and concluded it's because Bytemd doesn't like Vite / Sveltekit out-of-the-box. Adding export default defineConfig({
// ...
optimizeDeps: { exclude: ["bytemd"]},
} To my |
I don't know what happened with this repository: there was already an issue on this, but it disappeared: https://github.com/bytedance/bytemd/issues/269 (broken link). I guess the maintainers deleted the repo and recreated it under the same name, thus loosing the previous issues. Nevertheless, I can confirm that @afiorillo 's solution works (I reported the trick in the issue above) Additionally, we have a warning (with sveltekit v2 & svelte v4)
|
This fix didn't work for me. |
This fix didn't work for me. either, I'm using vue-cli |
Does not work at all. |
I used this package in the Svelte:
The text was updated successfully, but these errors were encountered: