Closed himat closed 1 year ago
Welcome @himat! 👋 Sorry you ran into a spot of trouble. I'm not able to replicate the issue in a clean environment https://stackblitz.com/github/remarkjs/.github/tree/main/sandbox-templates/react-markdown-with-vite?file=src%2Fapp.tsx
A few things to try/consider:
yarn
installed the dependency into the _nodemodules folderreact-scripts
, webpack used to have issues with ESM module loadingHi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.
And: Use react 18, as is explained in the changelog. It has a correct export map. Earlier reacts have no export maps, and your bundler might not find the "extensionless" file.
I ran into this once too. Older versions of React (I think React 16), implements the JSX automatic runtime incorrectly. You need to update to a newer version of React.
I had the same problem and abandoned the upgrade when I realized I couldn't upgrade react-mardown 9.x from create-react-app + react17
Initial checklist
Affected packages and versions
9.0.0
Link to runnable example
No response
Steps to reproduce
I just installed this package into my existing project with
yarn add react-markdown
That worked fine
And then I made a component
I am using ╰─❯ node -v v19.6.1
╰─❯ yarn -v 1.22.15
Expected behavior
It should run normally
Actual behavior
When I then ran my project though (with
react-scripts start
), I get this errorRuntime
Other (please specify in steps to reproduce)
Package manager
yarn 1
OS
macOS
Build and bundle tools
Create React App