Closed eunnovax closed 5 years ago
Solved the issue by: 1) first installing symlink package: npm i symlink-dir
2) then writing LinkContracts.js script in /client:
"use strict"; const symlinkDir = require("symlink-dir"); const path = require("path");
symlinkDir("../build/contracts", "src/contracts") .then(result => { console.log(result); //> { reused: false }
return symlinkDir("../build/contracts", "src/contracts");
}) .then(result => { console.log(result); //> { reused: true } }) .catch(err => console.error(err));
3) and at last creating symlink command in package.json scripts: "scripts": { "link-contracts": "node LinkContracts.js" }
Whenever I execute step 5: cd client npm run start
I get the above error. It kind of make sense because /build folder is not inside /src folder, but since import SimpleStorageContract from "./build/contracts/SimpleStorage.json"; command has been in App.js by default, it doesn't make any sense to me.