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

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

@yurenju

Description

@yurenju

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions