Skip to content
This repository has been archived by the owner on Aug 6, 2020. It is now read-only.

oz compile error: The filename, directory name, or volume label syntax is incorrect. #6

Open
tab00 opened this issue Aug 5, 2019 · 12 comments

Comments

@tab00
Copy link

tab00 commented Aug 5, 2019

I'm using Windows 10.

I get the following output with errors after npm run start:

Compiled with warnings.

./src/components/Header/index.js
Line 3: 'logo' is defined but never used no-unused-vars

./src/components/Footer/index.js
Line 5: 'pencil' is defined but never used no-unused-vars

../contracts/Counter.sol
Error: Command failed: 'C:\Users-\Documents\Projects\openzeppelin-starter-kit-tutorial\node_modules.bin\oz' compile
The filename, directory name, or volume label syntax is incorrect.

../contracts/Wallet.sol
Error: Command failed: 'C:\Users-\Documents\Projects\openzeppelin-starter-kit-tutorial\node_modules.bin\oz' compile
The filename, directory name, or volume label syntax is incorrect.

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

@tab00
Copy link
Author

tab00 commented Aug 5, 2019

When I try oz compile in the main directory I get this output with errors:

× Compiling contracts with solc 0.5.10 (commit.5a6ea5b1)
Compilation errors:
@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/StandaloneERC20.sol:4:1: ParserError: Source "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Detailed.sol" not found: File import callback not supported
import "./ERC20Detailed.sol";
^---------------------------^

@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/StandaloneERC20.sol:5:1: ParserError: Source "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Mintable.sol" not found: File import callback not supported
import "./ERC20Mintable.sol";
^---------------------------^

@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/StandaloneERC20.sol:6:1: ParserError: Source "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Pausable.sol" not found: File import callback not supported
import "./ERC20Pausable.sol";
^---------------------------^

@OpenZeppelin\contracts-ethereum-package\contracts\access\roles\MinterRole.sol:4:1: ParserError: Source "Roles.sol" not found: File import callback not supported
import "../Roles.sol";
^--------------------^

@OpenZeppelin\contracts-ethereum-package\contracts\access\roles\PauserRole.sol:4:1: ParserError: Source "Roles.sol" not found: File import callback not supported
import "../Roles.sol";
^--------------------^

@OpenZeppelin\contracts-ethereum-package\contracts\lifecycle\Pausable.sol:4:1: ParserError: Source "access/roles/PauserRole.sol" not found: File import callback not supported
import "../access/roles/PauserRole.sol";
^--------------------------------------^

@OpenZeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20.sol:4:1: ParserError: Source "IERC20.sol" not found: File import callback not supported
import "./IERC20.sol";
^--------------------^

@OpenZeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20.sol:5:1: ParserError: Source "math/SafeMath.sol" not found: File import callback not supported
import "../../math/SafeMath.sol";
^-------------------------------^

@OpenZeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20Detailed.sol:4:1: ParserError: Source "IERC20.sol" not found: File import callback not supported
import "./IERC20.sol";
^--------------------^

@OpenZeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20Mintable.sol:4:1: ParserError: Source "ERC20.sol" not found: File import callback not supported
import "./ERC20.sol";
^-------------------^

@OpenZeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20Mintable.sol:5:1: ParserError: Source "access/roles/MinterRole.sol" not found: File import callback not supported
import "../../access/roles/MinterRole.sol";
^-----------------------------------------^

@OpenZeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20Pausable.sol:4:1: ParserError: Source "ERC20.sol" not found: File import callback not supported
import "./ERC20.sol";
^-------------------^

@OpenZeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20Pausable.sol:5:1: ParserError: Source "lifecycle/Pausable.sol" not found: File import callback not supported
import "../../lifecycle/Pausable.sol";
^------------------------------------^

@ylv-io
Copy link
Contributor

ylv-io commented Aug 5, 2019

Hey @tab00. It seems to be compiler related issue. Can you run truffle compile? Does it compiles fine? Also which version of truffle you use?

@tab00
Copy link
Author

tab00 commented Aug 6, 2019

I use [email protected] installed using npm -g.

Here's the output of truffle compile:

Compiling your contracts...===========================
C:\Users-.config\truffle\compilers\node_modules\soljson-v0.5.2+commit.1df8f40c.js:12
function Mua(a,c){a=a|0;c=c|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,la=0,na=0,oa=0;e=u;u=u+272|0;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;a:do switch(f[c>>2]|0){case 1:{x=0;g=qa(811,c|0)|0;i=x;x=0;if(!(i&1)?(x=0,i=qa(814,g|0)|0,g=x,x=0,!(g&1)):0){if(!i){f[e+240+8>>2]=0;f[e+240+8+4>>2]=0;f[e+240+8+8>>2]=0;f[e+240+20>>2]=-1;f[e+240>>2]=28768;f[e+240+4>>2]=28792;f[e+196>>2]=0;f[e+196+4>>2]=0;f[e+196+8>>2]=0;x=0;i=qa(722,32)|0;g=x;x=0;if(!(g&1)){f[e+196>>2]=i;f[e+196+8>>2]=-2147483616;f[e+196+4>>2]=20;j=i;k=267487;l=j+20|0;do{b[j>>0]=b[k>>0]|0;j=j+1|0;k=k+1|0}while((j|0)<(l|0));b[i+20>>0]=0;f[e+208>>2]=13996;g=e+208+4|0;f[g>>2]=f[e+196>>2];f[g+4>>2]=f[e+196+4>>2];f[g+8>>2]=f[e+196+8>>2];f[e+196>>2]=0;f[e+196+4>>2]=0;f[e+196+8>>2]=0;x=0;m=Sa

SyntaxError: Unexpected end of input
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at VersionRange.getCachedSolcByFileName (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\compilerSupplier\loadingStrategies\VersionRange.js:37:1)
at VersionRange.getCachedSolcByVersionRange (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\compilerSupplier\loadingStrategies\VersionRange.js:56:1)
at VersionRange.load (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\compilerSupplier\loadingStrategies\VersionRange.js:192:1)
at Promise (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\compilerSupplier\index.js:66:1)
at new Promise ()
at CompilerSupplier.load (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\compilerSupplier\index.js:43:1)
at findContracts.then.sourcePaths (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\profiler\index.js:93:1)
Truffle v5.0.30 (core: 5.0.30)
Node v10.16.1

@tab00
Copy link
Author

tab00 commented Aug 6, 2019

Truffle's MetaCoin example at https://www.trufflesuite.com/docs/truffle/quickstart compiles fine for me.

@tab00
Copy link
Author

tab00 commented Aug 6, 2019

I've just tried the Pet Shop tutorial at https://www.trufflesuite.com/tutorials/pet-shop and compilation works fine too.

@ylv-io
Copy link
Contributor

ylv-io commented Aug 6, 2019

I've tried you version and it works on linux machine. I'll try tomorrow on windows machine, don't have it at hand at that moment.

@tab00
Copy link
Author

tab00 commented Aug 10, 2019

How did it go in Windows?

@tab00
Copy link
Author

tab00 commented Aug 15, 2019

I've just tried a fresh install again of this tutorial, and the same errors appeared.

@ylv-io
Copy link
Contributor

ylv-io commented Aug 15, 2019

Hey @tab00. Sorry for a delay.
Can you verify that contracts are actually present at node_modules/@OpenZeppelin\contracts-ethereum-package\contracts\?

@tab00
Copy link
Author

tab00 commented Aug 16, 2019

Yes, they are all there.

@tab00
Copy link
Author

tab00 commented Sep 3, 2019

How is the progress? I'd like to try the tutorial.

@abcoathup
Copy link
Contributor

Hi @tab00,

One option would be to use Windows Subsystem for Linux: https://forum.openzeppelin.com/t/solidity-smart-contract-development-on-windows/2110

I am able to reproduce on native Windows and will need to investigate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants