#Is React-markdown broken in remix?

1 messages · Page 1 of 1 (latest)

round pine
#

whenever i try to use react-markdown for my component that renders markdown that comes from strapi rich-text component i am getting the following error

my current remix version is "@remix-run/dev": "2.3.1",

var import_devlop4 = require("devlop"); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/---/Desktop/Website/website/node_modules/devlop/lib/default.js from /Users/---/Desktop/Website/website/build/index.js not supported. Instead change the require of default.js in /Users/---/Desktop/Website/website/build/index.js to a dynamic import() which is available in all CommonJS modules. at Object.<anonymous> (/Users/---/Desktop/Website/website/build/index.js:3221:22)

inner stratus
#

ERR_REQUIRE_ESM means you're running in CJS mode and needs to add its dependencies to serverDependenciesToBundle in remix.config,

You can run npx rmx-cli get-esm-packages react-markdown to get a list of packages that you need to add.

tall cosmos
#

It's not broken

#

But it's very annoying

#

I know because I use it

#

I have to bundle so many dependancies to make it work.

inner stratus
#

Hopefully a thing in the past once vite is stable and default.