question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Misleading error message while trying to compile with an unsupported version

See original GitHub issue

Issue

Misleading error message while trying to compile with an unsupported version

Steps to Reproduce

  1. Start a new project with truffle 5.0.5
  2. Modify your truffle.js or truffle-config.js file to compile your contracts with solc 0.5.3
  3. Create a any new contract using pragma solidity 0.5.7
  4. Run npx truffle compile

Expected Behavior

To throw a more descriptive and accurate error 😃

Actual Results

Compiling your contracts...
===========================
Error: TypeError: Cannot read property '0' of null
    at async.whilst.error (~/test/node_modules/truffle/build/webpack:/packages/truffle-compile/profiler.js:375:1)
    at ~/test/node_modules/truffle/build/webpack:/packages/truffle-compile/~/async/dist/async.js:969:1
    at next (~/test/node_modules/truffle/build/webpack:/packages/truffle-compile/~/async/dist/async.js:5222:1)
    at <anonymous>

Environment

  • Operating System: mac osx 10.14.3
  • Truffle version (truffle version): 5.0.5
  • node version (node --version): 9.11.1
  • npm version (npm --version): 6.7.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
pcowgillcommented, Dec 6, 2019

If you have a Truffle config file setting your solc compiler to a version of 0.5.2 through 0.5.6, one concrete step you can try to confirm this is the issue you’re running into is commenting out that solc line in the config in order to use the Truffle default instead (as long as you’re using a Truffle version that doesn’t default to one of those solc versions) or specifying a newer solc version like 0.5.7.

4reactions
CruzMolinacommented, Apr 11, 2019

Wow, okay, so it turns out this is a solc error reporting bug (ethereum/solidity#6329) that’s been fixed in 0.5.7. For solc versions 0.5.2 thru 0.5.6, the parsing error was being reported on the wrong line. Will be updating the solc error handling on our side to address this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GLSL Unsupported Version - java - Stack Overflow
I'm trying to compile GLSL shaders for use in LWJGL with OpenGL. I'm on macOS Sierra. I get the following error when trying...
Read more >
Fixing Unsupported major.minor version 52.0 Error in Java
Unsupported major.minor version 52.0 comes when you are trying to run a class compiled using Java 1.8 compiler into a lower JRE version...
Read more >
Compiler Errors - GameMaker Manual
A compiler error happens when your game encounters some type of error that the syntax ... The compiler error messages will all follow...
Read more >
Troubleshooting and tips — Numba 0.50.1 documentation
There can be various reasons why Numba cannot compile your code, and raises an error instead. One common reason is that your code...
Read more >
Error with needs: from another project (#220917) - GitLab
Im using needs section in task, follows documentation. ... Error is: jobs:Build Keycloak:needs:need has an unsupported type.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found