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.

Failed to install or start extension - cannot read property 'startsWith' of underfined.

See original GitHub issue

Describe the bug autorest version: 3.0.6339 autorest command (they both fail):

autorest readme.md --csharp --csharp-sdks-folder=../../CSharp/ --target=Api.Labs --nsversion=v2020_05_01_preview
autorest readme.md --typescript --typescript-sdks-folder=../../TypeScript --target=Api.Labs --nsversion=v2020_05_01_preview

Issue: Whenever I run the above commands, I get this error message:

Failed to install or start extension '@microsoft.azure/autorest.csharp' (2.3.91)
  TypeError: Cannot read property 'startsWith' of undefined

or

Failed to install or start extension '@microsoft.azure/autorest.typescript' (4.2.4)
  TypeError: Cannot read property 'startsWith' of undefined

I have tried autorest --reset, does not help (also npm cache clean --force). I installed autorest@3.1.5 and ran the same command, it succeeds in installing the extensions to the .autorest folder, but errors out on a different issue ( #4056 ). So if I use that to install the extensions, then go back to 3.0.6339, it still fails. My .autorest folder has these installed:

@autorest_core@3.0.6375
@autorest_core@3.1.3
@autorest_csharp@3.0.0-beta.20210412.4
@autorest_modelerfour@4.15.421
@autorest_modelerfour@4.15.456
@autorest_modelerfour@4.17.2
@autorest_typescript@6.0.0-alpha.20210309.1
@autorest_typescript@6.0.0-dev.20201105.2
@microsoft.azure_autorest.csharp@2.3.91
@microsoft.azure_autorest.modeler@2.3.51
@microsoft.azure_autorest.modeler@2.3.55
@microsoft.azure_autorest.typescript@4.2.4

This was working fine yesterday and this morning, and with 0 changes to my openapi spec it has started failing. Uninstalling and re-installing autorest does not help. 3.0 is completely unusable for me now (tried a few versions) and 3.1 errors out with the linked issue above.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jviaucommented, Apr 13, 2021

I was able to get autorest 3.1 working (thanks to your help!) with the the pinned csharp and typescript versions - so I am not too concerned about this issue anymore. Unless you want to understand why it is not defaulting to v2?

0reactions
timotheeguerincommented, Apr 13, 2021

can you try adding to your config either v2:true or version: ~2.0.4413

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'startsWith' of undefined #509 - GitHub
When I try to create a pdf from a adoc file out of VS Code I get an error message "Cannot read property...
Read more >
Error loading Merge Requests - "Cannot read property ...
I'm only getting the VS Code "Cannot read property 'startsWith' of null" Error without any further information. Possible fixes.
Read more >
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 >
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 >
React Native [TypeError: Cannot read property 'startsWith' of ...
I'm getting this error when I put my Javascipt code to a Typescript project. In Javascript project its worked fine but when I...
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