nhn / tui.editor

🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
http://ui.toast.com/tui-editor
MIT License
17.12k stars 1.74k forks source link

error Module has no default export editor-plugin-code-syntax-highlight #1753

Open anuj9196 opened 3 years ago

anuj9196 commented 3 years ago

Describe the bug

Installed following packages

npm install @toast-ui/editor-plugin-code-syntax-highlight
npm install prismjs
npm i --save-dev @types/prismjs

Importing plugin in the Angular 12 component

import codeSyntaxHighlight from "@toast-ui/editor-plugin-code-syntax-highlight";

After import, it gives error

Error: node_modules/@toast-ui/editor-plugin-code-syntax-highlight/types/index.d.ts:2:8 - error TS1192: Module '"/../app/node_modules/@types/prismjs/index"' has no default export.

2 import Prism from 'prismjs';

To Reproduce

  1. Install the dependencies in the Angular 12 project
  2. Import the plugin
  3. Run ng s
  4. It will give the error

Expected behaviour

It should be working

Screenshots

Screenshot 2021-08-13 at 8 58 36 AM

Desktop (please complete the following information):

Additional context

Add any other context about the problem here. @toast-ui/editor: 3.0.2 @toast-ui/editor-plugin-code-syntax-highlight: 3.0.0 prismjs: 1.24.1 @types/prismjs: 1.16.6 typescript: 4.3.2 node: 14.17.0

ats1999 commented 3 years ago

@anuj9196 Can you give some information about this editor: https://docs.google.com/forms/d/e/1FAIpQLSdhPRNZlEknQcx0V9Ww5U2sAbN_wv3WTmFeWIOIX21LRjFd7Q/viewform

snowdream commented 1 year ago

have a try.

import * as Prism from 'prismjs'