Cannot read property 'searchPaths' of undefined
See original GitHub issuemainThreadExtensionService.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:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
No results found
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 FreeTop 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
Top GitHub Comments
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
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.