On Windows 10, VS Code IDE: when following the PET Store tutorial, I get the following error when writing a test file:
import "truffle/Assert.sol"; - Source truffle/Assert.sol not found
Looks like truffle folder is not recognized
I deleted and recreated the project, and it now works.
I am experiencing the same issue but I am using ubuntu 16.04 instead of windows. Could you specify what you mean by you deleted and recreated the project? Do you mean the whole dApp? or just on VS COde?
I deleted the "project" the whole dapp and re-cloned the repository to where I left of. When I re-ran the test it seemed to have imported the missing solc files. I think its a weird thing that effects VS Code.
I鈥檓 having the same issue following the pet shop tutorial. The tutorial does not mention a git repo to clone, we just unbox the pet-shop box.
I don鈥檛 think the editor plays a part in this problem. Where should these files be located? Don鈥檛 they come included with the truffle package that is installed globally?
I was following the react-auth-box , the tutorial i was following didnt have a git repo but i made a repo for myself and deleted the whole DApp I was working on (backed up just in case). I then downloaded my files back and continued where i left of.
If anyone can explain this in greater / clearer detail that would be great.
I had this error with the last version of truffle: 4.1.12
I did this because I was also fine using the truffle 4.1.3 version:
npm view truffle versions
npm uninstall -g truffle
npm install -g [email protected]
truffle compile
truffle test
That worked for me.
on ubuntu i had the same problem
but i had 2 test files a sol and .js
when i've remove .sol test everything works fine again
on ubuntu i had the same problem
but i had 2 test files a sol and .js
when i've remove .sol test everything works fine again
Deleting the file isn't really a resolution. The .sol file is an example of how to write tests in Solidity as opposed to JS.
FWIW, I'm having this problem also on OSX.
VSCode 1.27.2
OSX High Sierra 10.13.6
Node 10.8.0
Truffle 4.1.14
Solidity 0.4.24
From the windos command line (i.e. the gitbash command line) it didn't work for me (Windows 7). But it worked from the truffle develop command line
truffle develop
truffle(develop)> test
or
truffle(develop)> test ./test/TestMetacoin.sol
truffle(develop)> test ./test/metacoin.js
Most helpful comment
I鈥檓 having the same issue following the pet shop tutorial. The tutorial does not mention a git repo to clone, we just unbox the pet-shop box.
I don鈥檛 think the editor plays a part in this problem. Where should these files be located? Don鈥檛 they come included with the truffle package that is installed globally?