TypeError: Cannot read property 'startsWith' of undefined
See original GitHub issueIssue Description
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:
- Created 2 years ago
- Reactions:13
- Comments:13 (2 by maintainers)
Top 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 >
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
I can confirm I’m still seeing these errors.
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 codehttps://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 fromcodecov
is misleading. Hopefully this tip helps troubleshooting your problems as well.