mapbox / rehype-prism

rehype plugin to highlight code blocks in HTML with Prism (via refractor)
MIT License
178 stars 24 forks source link

Runtime error with webpack 5 & babel 7 -- Uncaught TypeError: visit is not a function #29

Closed turenc closed 3 years ago

turenc commented 3 years ago

Hi,

We want to use more up-to-date packages in our project but, when we are upgrade the "webpack" version 4 to 5 and upgrade the "babel.js" 6 to 7 versions in our package.json, an issue occurs with the "uiwjs/react-md-editor" library or (rehype, rehype-prism etc.) dependencies of "uiwjs/react-md-editor" on runtime.

Sample: https://github.com/turenc/-uiw-react-md-editor Error: "Uncaught TypeError: visit is not a function" on "node_modules/@mapbox/rehype-prism/index.js"

I would appreciate your help in this matter.

turenc commented 3 years ago

I forked all 3rd and fixed.