Skip to content

Getting error as 'cannot use import statement outside a module for remark-gfm' #807

Discussion options

You must be logged in to vote

Hey @venumanthena 👋
Sorry you ran into a spot of trouble.
It sounds like you are using remark-gfm version 2 with react-markdown version 6?

If so two things:

  1. react-markdown version 6 isn't compatible with remark-gfm version 2, hold on remark-gfm version 1 for now (see: remarkjs/react-markdown#629)
  2. remark-markdown version 7 is incoming soon, and will support remark-gfm version 2. Part of remark-gfm version 2 is that it uses ESModule packaging, the error you are seeing "cannot use import statement outside module" looks to be related to a tool not being configured to support ESM, this guide from Sindre provides advise on how to use ESM with a number of build tools https://gist.github.com/sin…

Replies: 2 comments 1 reply

This comment has been minimized.

Comment options

You must be logged in to vote
1 reply
@venumanthena
Comment options

Answer selected by venumanthena
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants