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.

Cannot read property 'searchPaths' of undefined

See original GitHub issue
mainThreadExtensionService.ts:65 TypeError: Cannot read property 'searchPaths' of undefined
at findFlutterSdk (/Users/kosyakov/.vscode/extensions/dart-code.dart-code-3.3.0/out/dist/extension.js:1)
at module.exports.t.SdkUtils.<anonymous> (/Users/kosyakov/.vscode/extensions/dart-code.dart-code-3.3.0/out/dist/extension.js:1)
at Generator.next (<anonymous>)
at o (/Users/kosyakov/.vscode/extensions/dart-code.dart-code-3.3.0/out/dist/extension.js:1)

In order to reproduce:

  • make sure that you don’t have flutter sdk
  • create a new flutter project
  • use locate sdk
  • see that nothing happens afterwards
  • check dev tools for an error

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
DanTupcommented, Aug 26, 2019

Flutter extension vNext will write a clear error to the console now if the Dart extension didn’t export an API:

https://github.com/Dart-Code/Flutter/commit/67f519acd0727493afbd6af22dfff5a5b07aeeff

0reactions
DanTupcommented, Aug 26, 2019

Ah yes… the extension API is a bit loose anyway (for example there’s no way to depend on specific versions of extensions) so extensions that have dependencies should be prepared for their dependencies to not activate, not provide an API, or provide the wrong API.

It looks like the Flutter extension doesn’t handle that well though - if you run the New Project from Docs command I think it’ll crash here:

https://github.com/Dart-Code/Flutter/blob/master/src/commands/sdk.ts#L8

Since it never checked the API export was defined. I’ll fix that for the next version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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