-
Notifications
You must be signed in to change notification settings - Fork 235
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
Module not found: Error: Can't resolve 'buffer' in '.../node_modules/shpjs/lib' #175
Comments
The use of |
Add this to your webpack file.
|
I can't do that as I am using create-react-app and cannot afford to eject neither can I change the webpack file |
Is there any solutions in a vite environment? |
I'm building for the web with webpack. To avoid this error message and also this one I have added: resolve: {
fallback: {
buffer: false
}
},
plugins: [
new NodePolyfillPlugin()
] |
see here #200 (comment) |
I try to upgrade my react project to react-scripts 5.0.0 which uses shpjs but when I do so and try to open it using npm start I get the following along with other errors. I think there is a breaking change on webpack and now does not recognize polyfils and node native variables like process or buffer inside client code.
Even after installing the package in the react project the errors insist because buffer is undefined inside the library on the client.
Do you have any idea how to resolve this? I have tried many different approaches to resolve the issue.
I have opened an issue on create-react-app official repo trying to find a solution describing what I have tried so far.
The text was updated successfully, but these errors were encountered: