Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error with 'util.inherits' in Vezgo SDK when using ReactJS + Vite" #64

Open
paulbse opened this issue Oct 13, 2023 · 0 comments
Open

Comments

@paulbse
Copy link

paulbse commented Oct 13, 2023

Hello,

I'm facing an issue when using the Vezgo SDK in a client-side ReactJS project, specifically with the Vite build tool. The error message I'm encountering is as follows:

"Module "util" has been externalized for browser compatibility. Cannot access "util.inherits" in client code.
get @ isBufferBrowser.js:7
[...] ion @ util.js:39
node_modules/vezgo-sdk-js/lib/vezgo.js @ util.js:45

Uncaught TypeError: util.inherits is not a function
at 97006 (vezgo.js:21743:7)
at webpack_require (vezgo.js:27193:18)"

This issue appears to be similar to problems faced with the jsonwebtoken library, which also requires polyfills. I have successfully added polyfills for local development but the issue persists in the production build.

I've read this resource which explains that Vite (and Webpack 5) do not polyfill Node.js built-in modules by default in order to maintain browser compatibility. Since Node.js built-in modules don't exist in the browser, it's reasonable that this practice is discouraged.

My question is: has anyone managed to find a workaround for this issue or a way to make the Vezgo SDK compatible with Vite and similar modern build tools? Any insights or solutions would be greatly appreciated.

Thks in Advance,
Paul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant