remarkjs / react-remark

React component and hook to use remark to render markdown
https://remarkjs.github.io/react-remark
MIT License
204 stars 7 forks source link

fix `module` declaration in `package.json` #12

Closed paraillegal closed 3 years ago

paraillegal commented 3 years ago

Using this library with the Snowpack build-tool produces the following error when trying to execute snowpack dev:

[snowpack] ! installing dependencies...
[snowpack] Cannot find module '/workspace/example-project/node_modules/react-remark/dist/react-markdown.esm.js'
Require stack:
- /workspace/example-project/node_modules/esinstall/lib/index.js
- /workspace/example-project/node_modules/snowpack/lib/commands/install.js
- /workspace/example-project/node_modules/snowpack/lib/sources/local.js
- /workspace/example-project/node_modules/snowpack/lib/util.js
- /workspace/example-project/node_modules/snowpack/lib/commands/add-rm.js
- /workspace/example-project/node_modules/snowpack/lib/index.js
- /workspace/example-project/node_modules/snowpack/index.bin.js

I believe this is because the module declaration in package.json incorrect refers to a file named react-markdown.esm.js instead of react-remark.esm.js. https://github.com/remarkjs/react-remark/blob/main/package.json#L14

Updating that property for my local installed version of the library seemed to have fixed the issue.

ChristianMurphy commented 3 years ago

resolved in #13