My first library for React! #146609
Unanswered
MindfulLearner
asked this question in
Packages
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
Hi guys!
I'm trying to build my first react library for learning and utilities if could be any chance useful for others.
MindfulLearner/svgestor#14
TL;DR
The error occurs because Vite doesn’t automatically include polyfills for Node.js modules, like fs, which are not compatible with the browser. This happens when I try to use Node.js modules in browser code. The recommended solution is to avoid using Node.js modules in the browser or manually add polyfills, though the latter might not be ideal. In my case, I’m trying to read and manipulate an SVG file in the browser, which causes the issue. It’s better to consider an alternative, like loading the SVG via an HTTP request instead of using fs.
are there any other method?
ty everyone
Beta Was this translation helpful? Give feedback.
All reactions