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.

[rollbar] Unhandled exception: TypeError: Cannot read property 'startsWith' of undefined {}

See original GitHub issue

Brief Issue Summary

Whenever I try to do any build-related command, I get the following message (build is replaced with whatever command’s id, such as configure):

[rollbar] Unhandled exception: Unhandled Promise rejection: build TypeError: Cannot read property 'startsWith' of undefined {}

CMake Tools Log

[extension] [5024] cmake.build started
[main] Run build 
[main] Starting new CMake driver
[main] Starting CMake driver
[legacy-driver] Creating instance of LegacyCMakeDriver
[driver] CMakeDriver Kit set to Visual Studio Community 2017 - x86
[kit] OK running C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat x86, env vars:[["CL",""],["_CL_",""],["INCLUDE","..."],["LINK",""],["_LINK_",""],["LIB","..."],["TMP","..."],["FRAMEWORKDIR","..."],["FRAMEWORKDIR64",""],["FRAMEWORKVERSION","v4.0.30319"],["FRAMEWORKVERSION64",""],["UCRTCONTEXTROOT",""],["UCRTVERSION","10.0.17763.0"],["UNIVERSALCRTSDKDIR","..."],["VCINSTALLDIR","..."],["VCTARGETSPATH",""],["WINDOWSLIBPATH","..."],["WINDOWSSDKDIR","..."],["WINDOWSSDKLIBVERSION","..."],["WINDOWSSDKVERSION","..."],["VISUALSTUDIOVERSION","15.0"]]
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[cache] Reading CMake cache file c:/.../CMakeCache.txt
[cache] Parsing CMake cache string
[driver] Setting new variant , Emit debug information without performing optimizations
[driver] Run _refreshExpansions
[driver] Run _refreshExpansions cb
[rollbar] Unhandled exception: Unhandled Promise rejection: build TypeError: Cannot read property 'startsWith' of undefined {}

Developer Tools Log

console.ts:134 [Extension Host] [CMakeTools] 2019-05-09T13:36:04.849Z [fatal] [rollbar] Unhandled exception: Unhandled Promise rejection: build TypeError: Cannot read property 'startsWith' of undefined {}
t.log @ console.ts:134
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:399
_invokeHandler @ rpcProtocol.ts:384
_receiveRequest @ rpcProtocol.ts:304
_receiveOneMessage @ rpcProtocol.ts:226
_protocol.onMessage.e @ rpcProtocol.ts:101
fire @ event.ts:584
a @ ipc.net.ts:392
e @ ipc.net.ts:399
fire @ event.ts:584
_receiveMessage @ ipc.net.ts:678
_socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:549
fire @ event.ts:584
acceptChunk @ ipc.net.ts:212
_register._socket.onData.e @ ipc.net.ts:173
t @ ipc.net.ts:24
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636
console.ts:134 [Extension Host] TypeError: Cannot read property 'startsWith' of undefined
	at parseCatchTestOutput (C:\...\vector-of-bool.cmake-tools-1.1.3\out\src\ctest.js:90:31)
	at parseTestOutput (C:\...\vector-of-bool.cmake-tools-1.1.3\out\src\ctest.js:107:16)
	at CTestDriver._reloadTestResults (C:\...\vector-of-bool.cmake-tools-1.1.3\out\src\ctest.js:306:38)
t.log @ console.ts:134
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:399
_invokeHandler @ rpcProtocol.ts:384
_receiveRequest @ rpcProtocol.ts:304
_receiveOneMessage @ rpcProtocol.ts:226
_protocol.onMessage.e @ rpcProtocol.ts:101
fire @ event.ts:584
a @ ipc.net.ts:392
e @ ipc.net.ts:399
fire @ event.ts:584
_receiveMessage @ ipc.net.ts:678
_socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:549
fire @ event.ts:584
acceptChunk @ ipc.net.ts:212
_register._socket.onData.e @ ipc.net.ts:173
t @ ipc.net.ts:24
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636
notificationsAlerts.ts:40 Cannot read property 'startsWith' of undefined
onDidNotificationChange @ notificationsAlerts.ts:40
_register.model.onDidNotificationChange.e @ notificationsAlerts.ts:26
fire @ event.ts:584
notify @ notifications.ts:113
error @ notificationService.ts:49
commandService.executeCommand.then.e @ statusbarPart.ts:373
_tickCallback @ internal/process/next_tick.js:68
Promise.then (async)
executeCommand @ statusbarPart.ts:373
entry.command.t.push.E.addDisposableListener @ statusbarPart.ts:295

Platform and Versions

  • Operating System: Windows
  • CMake Version: cmake version 3.14.3 (I think this error started happening after upgrading CMake from 3.12)
  • VSCode Version: 1.33.1
  • CMake Tools Extension Version: 1.1.3
  • Compiler/Toolchain: Visual C++ 2017

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
el-robocommented, May 14, 2019

I encountered the same issue on linux. Issue seemed to be related to the loading or parsing of test results. It went away after I cleared my build directory and configured again.

0reactions
linjiaprocommented, Oct 13, 2020

Yep, thanks for this thread. Cleaning the build folder works for me on Linux platform.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'startsWith' of undefined
On one function I get the following error message: "TypeError: Cannot read property 'startsWith' of undefined" What causes this message.
Read more >
React Native [TypeError: Cannot read property 'startsWith' of ...
In Javascript project its worked fine but when I put the code into a Typescript project I got the error. Is there any...
Read more >
cannot read properties of undefined (reading 'listen') - You.com
Unhandled error in debug adapter: TypeError: Cannot read properties of ... when a record starts with one of the prefixes the # records...
Read more >
Cannot read property 'startsWith' of undefined node.js V12 ...
[Solved]-TypeError: Cannot read property 'startsWith' of undefined node.js V12.18.2-discord.js ... Instead of if (!msg.content.startsWith(config.prefix) , it ...
Read more >
Angular Error Handling Best Practices - Medium
We can't try to catch errors everywhere in the code. We need global error handling. Catch'em all. Fortunately, Angular provides a hook for...
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