Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

184
Visualizações
Custom named exports were specified for @toast-ui/editor/dist/esm/index.js but it does not appear to be a CommonJS module

To Reproduce

Steps to reproduce the behaviour:

  1. Install https://www.npmjs.com/package/create-react-library
  2. npx create-react-library custom-editor
  3. cd ustom-editor
  4. npm i @toast-ui/editor-plugin-chart @toast-ui/editor-plugin-code-syntax-highlight @toast-ui/editor-plugin-color-syntax @toast-ui/editor-plugin-table-merged-cell @toast-ui/editor-plugin-uml @toast-ui/react-editor katex mermaid --save-dev
  5. npm start
  6. custom-editor/index.js
import React from 'react'
import { Editor } from '@toast-ui/react-editor'

export default function EditorComponent() {
  return (
    <Editor
      initialValue='hello react editor world!'
      previewStyle='vertical'
      height='600px'
      initialEditType='markdown'
      useCommandShortcut
    />
  )
}

When I did the above-mentioned steps, I started getting the below error.

(commonjs plugin) Error: Custom named exports were specified for /home/rahul/Desktop/projects/temp/editor/tui/node_modules/@toast-ui/editor/dist/esm/index.js but it does not appear to be a CommonJS module
Error: Custom named exports were specified for /home/rahul/Desktop/projects/temp/editor/tui/node_modules/@toast-ui/editor/dist/esm/index.js but it does not appear to be a CommonJS module
    at transformCommonjs (/home/rahul/Desktop/projects/temp/editor/tui/node_modules/@rollup/plugin-commonjs/dist/index.js:753:13)
    at Object.transformAndCheckExports (/home/rahul/Desktop/projects/temp/editor/tui/node_modules/@rollup/plugin-commonjs/dist/index.js:1144:25)
    at Object.transform (/home/rahul/Desktop/projects/temp/editor/tui/node_modules/@rollup/plugin-commonjs/dist/index.js:1309:48)
    at /home/rahul/Desktop/projects/temp/editor/tui/node_modules/rollup/dist/shared/node-entry.js:13117:25

When I saw the content of @toast-ui/editor/dist/esm/index.js then I found below code

export { ToastUIEditor as Editor, ToastUIEditorCore as EditorCore, ToastUIEditor as default };

Start commend in package.json

"start": "microbundle-crl watch --no-compress --format modern,cjs"

How can I solve this problem?

Thanks in advance

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda