Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

relatively import path does not work on Windows without WSL #1558

Open
yurenju opened this issue Jun 20, 2020 · 2 comments · May be fixed by #1559
Open

relatively import path does not work on Windows without WSL #1558

yurenju opened this issue Jun 20, 2020 · 2 comments · May be fixed by #1559

Comments

@yurenju
Copy link

yurenju commented Jun 20, 2020

use relatively import on Windows without WSL does not work, for example: https://github.com/yurenju/oz-compile-failed-on-windows

Contract2.sol is imported via import "./Conntract2.sol" in Contract1.sol:

pragma solidity ^0.5.0;

import "./Contract2.sol";

contract Contract1 {
    uint256 public value;

    function increase() public {
      value++;
    }
}

but if run npm run compile on WIndows without WSL, it shows File import callback not supported

> oz compile
✖ Compiling contracts with solc 0.5.17 (commit.d19bba13)
Compilation errors: 
contracts\Contract1.sol:3:1: ParserError: Source "Contract2.sol" not found: File import callback not supported
import "./Contract2.sol";
^-----------------------^

I know you guys recommend developing smart contract on Windows with WSL on openzeppelin forum, but deploy contract on dev network via openzeppelin cli is not really stable in my experience, I usually need to reboot WSL to deploy contract if it complain connection refused.

so it would be great if we can have native windows support for openzeppelin cli without WSL and I actually found a solution, pull request is coming.

@yurenju yurenju linked a pull request Jun 20, 2020 that will close this issue
@abcoathup
Copy link
Contributor

Hi @yurenju ! Thanks for the suggestion, it is really appreciated.

The project owner will review your suggestion as soon as they can.

We normally recommend to wait until we have discussed an idea before writing any code or submitting a Pull Request, so we can go through the design beforehand. We don’t want you to waste your time!

@yurenju
Copy link
Author

yurenju commented Jun 22, 2020

@abcoathup thanks for reply! and no worry, I still can use that patch in a custom version of cli to solve my problem now which don't waste the time :D

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

Successfully merging a pull request may close this issue.

2 participants