Misleading error message while trying to compile with an unsupported version
See original GitHub issueIssue
Misleading error message while trying to compile with an unsupported version
Steps to Reproduce
- Start a new project with truffle 5.0.5
- Modify your
truffle.jsortruffle-config.jsfile to compile your contracts withsolc 0.5.3 - Create a any new contract using
pragma solidity 0.5.7 - 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:
- Created 4 years ago
- Reactions:3
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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
solcline 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.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.