Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
Se especificaron exportaciones con nombres personalizados para @toast-ui/editor/dist/esm/index.js pero no parece ser un módulo CommonJS

Reproducir

Pasos para reproducir el comportamiento:

  1. Instale https://www.npmjs.com/package/create-react-library
  2. npx create-react-library editor personalizado
  3. cd custom-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. inicio de npm
  6. editor personalizado/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 /> ) }

Cuando hice los pasos mencionados anteriormente, comencé a recibir el siguiente 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

Cuando vi el contenido de @toast-ui/editor/dist/esm/index.js , encontré el siguiente código

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

Comience a recomendar en package.json

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

¿Como puedó resolver esté problema?

Gracias por adelantado

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!