mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
1.57k stars 124 forks source link

[BUG] - Named export 'gfmStrikethrough' not found #481

Closed Davincible closed 1 month ago

Davincible commented 1 month ago

Any idea what might be causing this build error? worked fine before

Collecting page data  .file:///home/tyler/Launchpad/MemePad/frontend/node_modules/@mdxeditor/editor/dist/plugins/core/index.js:32
import { gfmStrikethrough } from "../../node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js";
         ^^^^^^^^^^^^^^^^
SyntaxError: Named export 'gfmStrikethrough' not found. The requested module '../../node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '../../node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js';
const { gfmStrikethrough } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)

> Build error occurred
Error: Failed to collect page data for /Dashboard/CreateListing
    at /home/tyler/Launchpad/MemePad/frontend/node_modules/next/dist/build/utils.js:1268:15 {
  type: 'Error'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Davincible commented 1 month ago

https://github.com/mdx-editor/editor/commit/1bab51b4222194ebdb70ca66155273e00a009850

Seems to come from here, version before this works fine

petyosi commented 1 month ago

How can I reproduce this on my side? Just upgraded the sample next project to the latest version, and it runs and builds without issues.

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 3.4.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: