Building Dapp Frontends with React & Network.js

Hi team, was trying to follow this tutoria but keep running into the issue of not being able to fire up this in the browser. I keep getting the error: 'Module not found: Can’t resolve ‘@openzeppelin/network/react’ in ‘/Users/rghadamian/web3/web3-infura/client/src’

Not sure what I’ve done wrong?

1 Like

Hi @RGhadamian,

Welcome to the community :wave:

I am sorry that you are running into an issue with the tutorial.

What operating system, node and npm versions are you using?

Mac OS

npm --version
node --version

1 Like

Hi @RGhadamian,

Hello, I only just realized it was you when I clicked on your profile picture. Great to see you in the forum. :australia:

It looks like ln -s ./lib/react ./react failed to run as part of the preinstall for OpenZeppelin Network.js.

As a work around if you replace in your App.js the line:
import { useWeb3 } from '@openzeppelin/network/react';
with the following:
import { useWeb3 } from '@openzeppelin/network/lib/react';

You should then be able to run the dapp.

You could also try running ln -s ./lib/react ./react in your project root directory. This is an issue on Windows (which is why I asked what operating system you were using).

Hi dude,

Thanks, I changed that but it didn’t seem to work. Went to rebuild the open using

npm install @openzeppelin/network

and came up with a whole bunch of error messages saying there’s no Xcode or CLT version detected. That’s possibly the reason why it’s failing?

How can I fix this?

1 Like

I fixed it, reinstalled xcode CLI Thx

1 Like

Hi @RGhadamian,

Glad you could resolve.