It may be dependency issues; I tried re installing openzeppelin/network got the following output:
root:client# npm install @openzeppelin/networknpm WARN @typescript-eslint/eslint-plugin@1.13.0 requires a peer of eslint@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/parser@1.13.0 requires a peer of eslint@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ajv-keywords@3.4.1 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@5.0.1 requires a peer of eslint-plugin-react-hooks@1.x but none is installed. You must install peer dependencies yourself.
npm WARN react-app-rewired@2.1.0 requires a peer of react-scripts@^2.1.3 but none is installed. You must install peer dependencies yourself.
npm WARN ts-pnp@1.1.2 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})+ @openzeppelin/network@0.2.10updated 1 package and audited 1061084 packages in 18.953s
found 14248 vulnerabilities (6 low, 3 moderate, 14239 high) run npm audit fix to fix them, or npm audit for details
I pushed ahead until help arrives:(it seems the straightforward installation of gsn-starter-kit is somewhat a twisted rocky road). Manually installing missing dependencies is not recommended. However the important react-scripts was missing (?) so I installed it than ran into es-lint version problems which I corrected but I still get a compilation error:
Now when I run the start script with yarn,
Attempted import error: 'PublicAddress' is not exported from 'rimble-ui'.
I see the error in line 2 of /src/components/Web3Info/index.js
import { PublicAddress, Button } from 'rimble-ui';
new versions rimble-ui do not export PublicAddress ..
system requirements are good to know:
I'm using Ubuntu 16.04 via ssh
My node default was version 11.6 but but got errors so I switched via nvm which gave the errors in my posts. So presently my :
$ node --version
v10.16.3
$ npm --version
6.9.0
$ oz --version
2.5.3
Before I make updates maybe tell me what are the minimum system requirements?
I made a fresh directory , used NVM to set the node version to 10.16 then followed each installation step. (without the sass errors)
#yarn start
Failed to compile
./src/App.js
Module not found: Can't resolve '@openzeppelin/network/react' in '/home/workspace/Starter-gsn-kit/client/src'
@abcoathup can you please show your installation steps and why react wasn't in the 'network' folder? I had to edit the App.js import to @openzeppelin/network/lib/react│
There must be some alias thing missing ?
$ openzeppelin unpack OpenZeppelin/starter-kit-gsn
✓ Kit downloaded and unpacked
The kit is ready to use.
Quick Start
Run your local blockchain:
> ganache-cli --deterministic
Initialize the OpenZeppelin SDK project:
> openzeppelin init app
Go to the client directory:
> cd client
Run the React app:
> npm run start
Continue in your browser!
More at https://github.com/OpenZeppelin/starter-kit-gsn
Initialize project
$ oz init starter
? Initial project version 1.0.2
Project initialized. Write a new contract in the contracts folder and run 'openzeppelin create' to deploy it.
Deploy Counter contract
$ oz create
✓ Compiling contracts with Truffle, using settings from truffle.js file
Truffle output:
Compiling your contracts...
===========================
> Compiling ./contracts/Counter.sol
> Compiling @openzeppelin/contracts-ethereum-package/contracts/GSN/Context.sol
> Compiling @openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol
> Compiling @openzeppelin/contracts-ethereum-package/contracts/GSN/IRelayHub.sol
> Compiling @openzeppelin/contracts-ethereum-package/contracts/GSN/IRelayRecipient.sol
> Compiling @openzeppelin/upgrades/contracts/Initializable.sol
> Artifacts written to /c/Users/andre/Documents/projects/forum/starter/build/contracts
> Compiled successfully using:
- solc: 0.5.12+commit.7709ece9.Emscripten.clang
? Pick a contract to instantiate Counter
? Pick a network development
✓ Added contract Counter
✓ Contract Counter deployed
All contracts have been deployed
? Call a function to initialize the instance after creating it? Yes
? Select which function * initialize(num: uint256)
? num (uint256): 42
✓ Setting everything up to create contract instances
✓ Instance created at 0x630589690929E9cdEFDeF0734717a9eF3Ec7Fcfe
0x630589690929E9cdEFDeF0734717a9eF3Ec7Fcfe
Start dapp
$ cd client
$ npm run start
The terminal shows one warning
Compiled with warnings.
./node_modules/web3-eth-accounts/src/scrypt.js
Critical dependency: the request of a dependency is an expression
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
Fund recipient contract
I funded the recipient contract in a separate terminal
$ npx oz-gsn fund-recipient --recipient 0x630589690929E9cdEFDeF0734717a9eF3Ec7Fcfe
Recipient 0x630589690929E9cdEFDeF0734717a9eF3Ec7Fcfe balance is now 1000000000000000000 wei
OpenZeppelin Network.js uses preinstall npm hook to create the symlink for react hooks.
It sounds like for some reason this symlink is not being created.
As you found, a work around is to import hooks directly from openzeppelin/network/lib/react.