Markdown-Blog icon indicating copy to clipboard operation
Markdown-Blog copied to clipboard

Change in `marked` package causes TypeError

Open TogetherBuilt opened this issue 1 year ago • 0 comments

Description

The marked package has changed the way it exports its functionality in a recent version. It now exports an object that contains a function named marked, rather than exporting the function directly. This causes a TypeError: marked is not a function error when trying to use marked as a function.

Steps to Reproduce

  1. Install the latest version of marked with npm install marked@latest.
  2. Try to use marked as a function in the code.

Expected Behavior

marked should be a function that can be used to convert markdown to HTML.

Actual Behavior

marked is an object, and trying to use it as a function causes a TypeError.

Possible Solution

Adjust the import statement to use the marked function from the exported object:

const { marked } = require('marked');

TogetherBuilt avatar Jun 03 '24 03:06 TogetherBuilt