Getting error as 'cannot use import statement outside a module for remark-gfm' #807
Answered
by
ChristianMurphy
venumanthena
asked this question in
Q&A
-
Hi, |
Beta Was this translation helpful? Give feedback.
Answered by
ChristianMurphy
Aug 12, 2021
Replies: 2 comments 1 reply
This comment has been minimized.
This comment has been minimized.
-
Hey @venumanthena 👋 If so two things:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
venumanthena
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @venumanthena 👋
Sorry you ran into a spot of trouble.
It sounds like you are using
remark-gfm
version 2 withreact-markdown
version 6?If so two things:
react-markdown
version 6 isn't compatible withremark-gfm
version 2, hold onremark-gfm
version 1 for now (see: remarkjs/react-markdown#629)remark-markdown
version 7 is incoming soon, and will supportremark-gfm
version 2. Part ofremark-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…