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

Impossible to include plugins #279

Open
OlegLenskiy opened this issue Apr 14, 2024 · 1 comment
Open

Impossible to include plugins #279

OlegLenskiy opened this issue Apr 14, 2024 · 1 comment

Comments

@OlegLenskiy
Copy link

OlegLenskiy commented Apr 14, 2024

Hello. When i try import katex i'm getting errors
import "@kangc/v-md-editor/lib/plugins/katex/cdn"

✘ [ERROR] Could not resolve "@babel/runtime/helpers/interopRequireDefault"

node_modules/@kangc/v-md-editor/lib/plugins/katex/cdn.js:3:37:
  3 │ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
    ╵                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

What i'm doing wrong? Help me please

@cbrgpl
Copy link

cbrgpl commented Apr 19, 2024

There is some problem with katex plugin. I'm catching this error, when import it:

Please import resources katex from cdn [parser-cdn.js:13:10](http://localhost:8081/node_modules/@kangc/v-md-editor/lib/plugins/katex/parser-cdn.js)
    js parser-cdn.js:13
    __require chunk-NIBQISYW.js:9
    js cdn.js:10
    __require chunk-NIBQISYW.js:9
    <anonymous> @kangc_v-md-editor_lib_plugins_katex_cdn.js:282

I imported and installed the plugin following the instructions from docs.

My code:

main.ts

import VueMarkdownEditor from '@kangc/v-md-editor'
import '@kangc/v-md-editor/lib/style/base-editor.css'
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js'
import '@kangc/v-md-editor/lib/theme/style/vuepress.css'

import createKatexPlugin from '@kangc/v-md-editor/lib/plugins/katex/cdn'
import Prism from 'prismjs'

const app = createApp( App )

VueMarkdownEditor.use( vuepressTheme, {
  Prism,
} )
VueMarkdownEditor.use( createKatexPlugin() )

app.use( VueMarkdownEditor )

In vue

<template >
  <div class="grid items-center justify-center w-full h-full p-8 overflow-y-auto" >
    <!-- eslint-disable-next-line vue/component-name-in-template-casing -->
    <v-md-editor
      v-model="text"
      class="w-full"
      height="400px" ></v-md-editor>
  </div>
</template>

UPD my packages version:

 "@kangc/v-md-editor": "^2.3.18",
 "prismjs": "^1.29.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants