GSN Starter Kit compilation problems

The installation and running of the starter GSN App was with some difficulty:

  1. Had to use Yarn to run the start script. npm just would just fail silently
  2. The node-sass vendor binding was missing so I could not compile. The solution for that found in the sass github issue.
  3. Now I get this compilation module error:
Failed to compile../src/App.js
Module not found: Can't resolve '@openzeppelin/network/react' in '/home/workspace/starter-kit-gsn/client/src'

Any help on this would be appreciated.

1 Like

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

1 Like

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 …

1 Like

Hi @Steeve,

Sorry to hear that you are having issues with the GSN Starter Kit.

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

I am using Windows Subsystem for Linux on Windows 10 with the following node and npm versions:

$ node --version
v10.16.0
$ npm --version
6.13.4
$ oz --version
2.6.0

I just ran the GSN Starter Kit on the above setup, so unfortunately didn’t have the same experience that you did.

openzeppelin unpack OpenZeppelin/starter-kit-gsn

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?

1 Like

Hi @Steeve,

There isn’t an explicit minimum system requirement (that I know of).

I can change my versions to match what you are using to see if I can reproduce what you are experiencing.

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 ?

1 Like

Hi @Steeve,

I’m sorry that you are still having issues.
The following are my installation steps using the following versions:

$ node --version
v10.16.0
$ npm --version
6.13.4
$ oz --version
2.6.0

Create directory

$ mkdir starter && cd starter

Unpack GSN Starter Kit

$ 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

I updated OZ to version 2.6.0 did th steps above. Start script fails with the same error as before :

Module not found: Can’t resolve ‘@openzeppelin/network/react’ in ‘/home/workspace/Starter-gsn-kit/client/src’

I have to manually edit line 4 in App.js with the correct path

@openzeppelin/network/ lib /react

to get it to run.

1 Like

Hi @Steeve,

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.

What operating system are you using?

I use Linux Ubuntu 16.04 operating system on a VPS (I ssh via an old macbook bash terminal).