Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GFM ESM error in Remix 💿 #36

Closed
4 tasks done
ShafSpecs opened this issue Jan 31, 2022 · 2 comments
Closed
4 tasks done

GFM ESM error in Remix 💿 #36

ShafSpecs opened this issue Jan 31, 2022 · 2 comments
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on

Comments

@ShafSpecs
Copy link

Initial checklist

Affected packages and versions

.0.1

Link to runnable example

No response

Steps to reproduce

  • Install reamrk-gfm via npm
  • import into a server component in Remix
  • Set as an XDM plugin
  • Run the app

Expected behavior

App works fine and the markdown to HTML process is happyThe app

Actual behavior

Error thrown

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\${user}\Documents\project\node_modules\remark-gfm\index.js
require() of ES modules is not supported.
require() of C:\Users\user\Documents\proj\node_modules\remark-gfm\index.js from C:\Users\user\Documents\proj\api\_build\index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename C:\Users\user\Documents\project\node_modules\remark-gfm\index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\user\Documents\proj\node_modules\remark-gfm\package.json.

Runtime

Node v14

Package manager

npm 7

OS

Windows

Build and bundle tools

esbuild, Remix

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jan 31, 2022
@ChristianMurphy
Copy link
Member

Hey @ShafSpecs 👋
Sorry you ran into a spot of trouble.
This is an issue in remix and has been reported there several times remix-run/remix#109, remix-run/remix#1283, remix-run/remix#1279
There are some suggestions on how to work around this while remix works on a fix in remix-run/remix#109 (comment) and remix-run/remix#109 (comment)

@wooorm wooorm added 👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on labels Jan 31, 2022
@wooorm wooorm closed this as completed Jan 31, 2022
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Jan 31, 2022
@github-actions

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

3 participants