Skip to content

Got "compiler version specified twice!" Error #34

@arjunaskykok

Description

@arjunaskykok

I used Remix Ethereum. I activated Vyper plugin. Then I uploaded this code as Storage.vy:

# @version ^0.3.0 

number: uint256 

@external 
def store(num: uint256): 
    self.number = num 

@external 
def retrieve() -> uint256: 
    return self.number

Then I ran this command in the terminal:

docker run -p 8000:8000  ghcr.io/apeworx/hosted-compiler:latest

I set the compiler to local compiler and the URL to http://localhost:8000. When I clicked the Compile button, I got this error:

Screenshot 2024-04-10 at 19 55 31

On the left side, I got "Cannot read properties of undefined (reading 'split')" error. On the right side, I saw that I got this error:

[
    "contracts/Storage.vy\nStructureException:line 3:0 compiler version specified twice!"
]

If I removed # @version ^0.3.0 line, the compilation would be successful.

When I compile with offline Vyper compiler, the pragma line doesn't give me troubles.

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