"Invalid input source specified" - Remix Solidity IDE error
Asked Answered
A

4

5

I have removed everything from my remix IDE, except the following:

pragma solidity ^0.6.6;

contract daily_unlimited_deFitasy{
}

And yet I am still getting the following error when attempting to compile:

Invalid input source specified

Why am I getting this error?

Acroter answered 12/5, 2020 at 20:23 Comment(0)
A
15

I found out what was wrong. A user gets this error anytime a file for compilation is missing. The most common way this can come up is if your session expired or your cookies/history has been deleted.

If this is the case, a simple refresh will solve the error. Be sure to copy the source code in front of you so you can repaste it after the refresh completes.

Acroter answered 13/5, 2020 at 13:46 Comment(1)
A simple refresh works like amazing.Caras
S
0

For Me, it occured in my test scripts and what I did to resolve it, was to comment out this line: import "remix_accounts.sol";

Skew answered 5/2, 2021 at 20:33 Comment(0)
E
0

When Remix can not reach import file raises this error. Check your connection or comment out the one of imported files.

Enamelware answered 2/11, 2021 at 11:16 Comment(0)
C
0

I also had the same problem importing SafeMath for solidity compiler version 0.6.12. I tried refreshing the page as well but it didn't resolve the issue. I've looked around the internet but didn't find any solution that worked for me. So, I decided to look into it myself.

Here's the code snippet with the error here.

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.3/contracts/math/SafeMath.sol';
contract A{
    .... smart contract code ....
    .... smart contract code ....

Firstly, I checked OpenZeppelin's SafeMath.sol contracts code. In the code box, I could see the code, but I noticed that if I clicked the RAW button at the top right image showing RAW button, the raw code was taking way too long to load. So I guess that is why REMIX couldn't get the code and hence threw the error Invalid input source specified.

To test this hypothesis, I turned my VPN on to US and clicked on raw code. This time, the raw code loaded fast and the error in REMIX IDE went away. It seems REMIX IDE was able to get the file. Even after I turned off my VPN, REMIX IDE was able to compile the code. The imports seem to be stored in the browser storage, which is not even deleted after a hard refresh.

PS - This is my first stackoverflow answer. Sorry if I missed anything!

Copaiba answered 31/1, 2023 at 3:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.