Error: bundling failed. ReferenceError: SHA-1 not computed. Fix: recompute SHA-1


Issue: Unable to Connect MySQL with React Native App

I’m attempting to connect MySQL with my React Native app on an Ubuntu 16.04 system. I have installed Express, body-parser, and MySQL and created a server.js file in my project. When I type node server.js in the terminal, I get the following error:

error: bundling failed: ReferenceError: SHA-1 for file /usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js (/usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js) is not computed

I’m not sure what this error means or how to solve it. Can anyone provide assistance?

The error you are getting seems to be related to React Native’s bundling process. Try running npm cache clean --force and then npm start -- --reset-cache to clear the cache and reset the bundling process. If that doesn’t work, try updating your Node.js version to the latest stable release and run npm install to update all your dependencies.