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.

TypeError: Cannot read property 'startsWith' of undefined

See original GitHub issue

Hi, we run Codecov with npx codecov --token=${CODECOV_TOKEN} and starting from last week we started seeing these sporadic errors:

==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
    $ find /home/circleci/repo/frontend -type f -name '*.gcno'  -exec gcov  {} +
    Failed to run gcov command.
==> Scanning for reports
    + /home/circleci/repo/frontend/coverage/clover.xml
    + /home/circleci/repo/frontend/coverage/lcov.info
==> Uploading reports
/home/circleci/.npm/_npx/56c18755c3006eff/node_modules/teeny-request/build/src/agents.js:30
    var isHttp = uri.startsWith('http://');
                     ^

TypeError: Cannot read property 'startsWith' of undefined
    at Object.getAgent (/home/circleci/.npm/_npx/56c18755c3006eff/node_modules/teeny-request/build/src/agents.js:30:22)
    at requestToFetchOptions (/home/circleci/.npm/_npx/56c18755c3006eff/node_modules/teeny-request/build/src/index.js:86:30)
    at teenyRequest (/home/circleci/.npm/_npx/56c18755c3006eff/node_modules/teeny-request/build/src/index.js:143:14)
    at /home/circleci/.npm/_npx/56c18755c3006eff/node_modules/codecov/lib/codecov.js:213:9
    at /home/circleci/.npm/_npx/56c18755c3006eff/node_modules/teeny-request/build/src/index.js:233:13
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
npm ERR! code 1
npm ERR! path /home/circleci/repo/frontend
npm ERR! command failed
npm ERR! command sh -c codecov "--token="

Running the CI build again usually fixes it, are you aware of the issue?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:13
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
FezVrastacommented, Mar 3, 2021

I can confirm I’m still seeing these errors.

1reaction
anhnguyen1618commented, Apr 28, 2021

I had the same problem with codecov nodemodule and decided to dig deeper into the code. The problem in my case is that the token which I am using is invalid. I detected the root problem by logging the result in this code https://github.com/codecov/codecov-node/blob/master/lib/codecov.js#L215. In my case, the root error is: {'detail': ErrorDetail(string='Could not find a repository associated with upload token <MY_INVALID_TOKEN>', code='not_found')} even though the error message from codecov is misleading. Hopefully this tip helps troubleshooting your problems as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'startsWith' of undefined
Hi, im trying to connect to MongoAtlas run an app that uses mongodb (^4.3.1 ) in nodejs (version 10.19.0), Windows 7 & then...
Read more >
Cannot read property 'startsWith' of undefined - discord bot ...
Every time I attempt to command the bot in my discord chat (!on) I get the error "TypeError: Cannot read property 'startsWith' of...
Read more >
TypeError: Cannot read property 'startsWith' of undefined #324
I know there is a related error in #284, I decided to open a new issue as this hits us 100% of the...
Read more >
Cannot read property 'startsWith' of undefined - YouTube
Your browser can't play this video. ... Mongodb error solved - TypeError - Cannot read property 'startsWith' of undefined.
Read more >
Vue3 Cannot read property 'startsWith' of undefined - Laracasts
Vue3 Cannot read property 'startsWith' of undefined. Hi, I'm trying to setup laravel 8, vue 3, inertia, bootstrap 5. I was getting all...
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