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.

Need a better error message when CMake cannot be located

See original GitHub issue

Brief Issue Summary

Most of the operations with CMake Tools fail with unhandled exception errors.

CMake Tools Log

When I just open any CMake project in Visual Studio Code, I immediately get the following error in the output:

[rollbar] Unhandled exception: Error during CMake upgrade TypeError: Cannot read property '1' of null {"version":"3.13.2","linuxURL":"https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.sh","windowsURL":"https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-win64-x64.msi"}

And if I try to run CMake: Configure, then I get this error in the output:

[rollbar] Unhandled exception: Unhandled Promise rejection: configure TypeError: Cannot read property '1' of null {}

Developer Tools Log


[2019-08-14 10:02:51.391] [exthost] [info] extension host started
[2019-08-14 10:02:51.405] [exthost] [info] ExtensionService#_doActivateExtension mitaki28.vscode-clang {"startup":false,"activationEvent":"onLanguage:cpp"}
[2019-08-14 10:02:51.406] [exthost] [info] ExtensionService#loadCommonJSModule C:\Users\username\.vscode\extensions\mitaki28.vscode-clang-0.2.3\out\src\extension
[2019-08-14 10:02:51.411] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.cpptools {"startup":false,"activationEvent":"onLanguage:cpp"}
[2019-08-14 10:02:51.411] [exthost] [info] ExtensionService#loadCommonJSModule C:\Users\username\.vscode\extensions\ms-vscode.cpptools-0.24.1\dist\main
[2019-08-14 10:02:51.427] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"activationEvent":"*"}
[2019-08-14 10:02:51.427] [exthost] [info] ExtensionService#loadCommonJSModule e:\tools\vsc\resources\app\extensions\debug-auto-launch\dist\extension
[2019-08-14 10:02:51.428] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":true,"activationEvent":"*"}
[2019-08-14 10:02:51.428] [exthost] [info] ExtensionService#loadCommonJSModule e:\tools\vsc\resources\app\extensions\emmet\dist\extension
[2019-08-14 10:02:51.434] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"activationEvent":"*"}
[2019-08-14 10:02:51.434] [exthost] [info] ExtensionService#loadCommonJSModule e:\tools\vsc\resources\app\extensions\git\dist\main
[2019-08-14 10:02:51.445] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":true,"activationEvent":"*"}
[2019-08-14 10:02:51.445] [exthost] [info] ExtensionService#loadCommonJSModule e:\tools\vsc\resources\app\extensions\merge-conflict\dist\extension
[2019-08-14 10:02:51.447] [exthost] [info] ExtensionService#_doActivateExtension vincaslt.highlight-matching-tag {"startup":true,"activationEvent":"*"}
[2019-08-14 10:02:51.447] [exthost] [info] ExtensionService#loadCommonJSModule C:\Users\username\.vscode\extensions\vincaslt.highlight-matching-tag-0.9.3\out\src\extension
[2019-08-14 10:02:51.454] [exthost] [info] ExtensionService#_doActivateExtension vector-of-bool.cmake-tools {"startup":true,"activationEvent":"workspaceContains:CMakeLists.txt"}
[2019-08-14 10:02:51.454] [exthost] [info] ExtensionService#loadCommonJSModule C:\Users\username\.vscode\extensions\vector-of-bool.cmake-tools-1.1.3\out\src\extension
[2019-08-14 10:02:51.594] [exthost] [error] ProxyResolver#getCertificates (intermediate value) is not a function
[2019-08-14 10:02:51.676] [exthost] [info] eager extensions activated
[2019-08-14 10:02:52.642] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing {"startup":false,"activationEvent":"onLanguage:json"}
[2019-08-14 10:02:52.642] [exthost] [info] ExtensionService#loadCommonJSModule e:\tools\vsc\resources\app\extensions\configuration-editing\dist\extension
[2019-08-14 10:02:52.644] [exthost] [info] ExtensionService#_doActivateExtension vscode.extension-editing {"startup":false,"activationEvent":"onLanguage:json"}
[2019-08-14 10:02:52.644] [exthost] [info] ExtensionService#loadCommonJSModule e:\tools\vsc\resources\app\extensions\extension-editing\dist\extension
[2019-08-14 10:02:52.648] [exthost] [info] ExtensionService#_doActivateExtension vscode.json-language-features {"startup":false,"activationEvent":"onLanguage:json"}
[2019-08-14 10:02:52.648] [exthost] [info] ExtensionService#loadCommonJSModule e:\tools\vsc\resources\app\extensions\json-language-features\client\dist\jsonMain
[2019-08-14 10:02:52.655] [exthost] [info] ExtensionService#_doActivateExtension vscode.npm {"startup":false,"activationEvent":"onLanguage:json"}
[2019-08-14 10:02:52.655] [exthost] [info] ExtensionService#loadCommonJSModule e:\tools\vsc\resources\app\extensions\npm\dist\main

Platform and Versions

  • Operating System: Windows 10.0.18362.267 x64
  • CMake Version: 3.15.2
  • VSCode Version: 1.37.0
  • CMake Tools Extension Version: 1.1.3
  • Compiler/Toolchain: MSVC 2019 and Ninja, but I can reproduce it with others too. In fact, it never even gets to the compilers stuff, the error happens immediately

Other Notes/Information

It started happening all of the sudden. One minute it was all good, and then suddenly I started getting these errors. And I cannot recall any changes done to the system which could cause it.

Already tried deleting both CMake Tools and Visual Studio Code and installing them again.

I have also tried to reproduce it in the virtual machine with all the same tools and versions installed - there it all works just fine.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bobbrowcommented, Nov 5, 2019

This issue has been addressed in CMake Tools 1.2.0 which is available in the VS Code Marketplace or on the Releases Page

Because the publisher id has changed, VS Code does not automatically upgrade you yet. The Marketplace team will enable this in the next few days. If you want to install 1.2.0 now, please make sure you uninstall any earlier versions of CMake Tools manually to avoid any conflicts.

1reaction
bobbrowcommented, Aug 16, 2019

No worries. I had just finished digging through the code and was about to suggest a method to get the callstack. My testing had gotten me to the point where I suspected something wrong with the extension finding CMake, but I was going to follow up with you today on it. Either way, I think this is helpful for us to know because we should put a better error message there. I’m going to repurpose this issue to add a better message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Better error messages when trying to use a non-enabled ...
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly. Missing variable is: CMAKE_C_COMPILE_OBJECT.
Read more >
Cause CMAKE to generate an error - Stack Overflow
The message() method has an optional argument for the mode, allowing STATUS , WARNING , AUTHOR_WARNING , SEND_ERROR , and FATAL_ERROR .
Read more >
cmake project can't click on error - Visual Studio Feedback
Open the directory via “open local directory” in VS. · Make sure cmake cache is generated · build. · Make sure that double-clicking...
Read more >
CMake configuration issues - HepMC / HepMC3 - CERN GitLab
Issue 1: configure crashes if ROOT isn't found. Actually with some confusing message about FindROOT.cmake. Great to have it compile against ...
Read more >
When running make I get an error - Usage - CMake Discourse
You shouldn't have to. It's not clear how the project found the file and then it disappeared when it the build ran.
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