0

I am getting an error message that says: Module not found: You attempted to import ../contracts/PreciousChickenToken.json which falls outside of the project src/ directory. Relative imports outside of src/ are not supported. How do i setup my relative path properly to consider the directory structure? i imported my contract .sol file into app.js like this: import PreciousChickenToken from "./contracts/PreciousChickenToken.json";

MyApp
  build/contracts
    PreciousChickenToken.sol
  client
    src
      app.js
Luke
  • 83
  • 1
  • 1
  • 5
  • 1
    Take a look at the answer [here](https://stackoverflow.com/questions/44114436/the-create-react-app-imports-restriction-outside-of-src-directory). – wgumenyuk Nov 19 '20 at 08:17
  • @wgumenyuk hi thanks. yes, i already saw that but, I wanted to know specifically what I would need to type for my import line: ../contracts/PreciousChickenToken.json? I need something infront of ""../contracts". – Luke Nov 19 '20 at 09:58
  • maybe something like: "../../build/contracts/PreciousChickenToken.json"? – Luke Nov 19 '20 at 10:08
  • Yes, that should work. – wgumenyuk Nov 19 '20 at 10:42
  • thanks I got it to work – Luke Nov 19 '20 at 13:31

0 Answers0