Bloc: VSCode extension: command 'extension.new-bloc' not found

Created on 12 Nov 2019  Β·  26Comments  Β·  Source: felangel/bloc

Describe the bug
>Bloc: New Bloc command returns command 'extension.new-bloc' not found error.
Reproducible only in Flutter projects. When I try to create a bloc on server-side project, it lets me to do so. Reinstalling Bloc extension and restarting VSCode didn't help.
Interesting it worked few days ago. I was able to create the first bloc.

Bloc extension version: 2.0.0
VS Code info:
Version: 1.40.0
Commit: 86405ea23e3937316009fc27c9361deee66ffbf5
Date: 2019-11-06T17:09:34.601Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.0.0

To Reproduce
Steps to reproduce the behavior:

  1. CMD + Shift + P
  2. Type bloc
  3. Select Bloc: New Bloc
  4. See error

Expected behavior
I expect to see bloc name selector

Screenshots
Screenshot 2019-11-12 at 17 15 21

*Logs *
flutter analyze:
No issues found

[βœ“] Flutter (Channel stable, v1.9.1+hotfix.5, on Mac OS X 10.15 19A602, locale en-RU)
    β€’ Flutter version 1.9.1+hotfix.5 at /Users/andrey/flutter
    β€’ Framework revision 1aedbb1835 (4 weeks ago), 2019-10-17 08:37:27 -0700
    β€’ Engine revision b863200c37
    β€’ Dart version 2.5.0


[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    β€’ Android SDK at /Users/andrey/Library/Android/sdk
    β€’ Android NDK location not configured (optional; useful for native profiling support)
    β€’ Platform android-28, build-tools 28.0.3
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[βœ“] Xcode - develop for iOS and macOS (Xcode 11.0)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Xcode 11.0, Build version 11A420a
    β€’ CocoaPods version 1.8.4

[!] Android Studio (version 3.3)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    βœ— Flutter plugin not installed; this adds Flutter specific functionality.
    βœ— Dart plugin not installed; this adds Dart specific functionality.
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[βœ“] VS Code (version 1.40.0)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension version 3.6.0

[βœ“] Connected device (1 available)
    β€’ Android SDK built for x86 β€’ emulator-5554 β€’ android-x86 β€’ Android 8.1.0 (API 27) (emulator)

! Doctor found issues in 2 categories.
extension

Most helpful comment

I managed to fix the issue by simply replacing any version to actual version or a blank space:

equatable: any

to this:

equatable: ^1.0.1

or even

equatable:

in pubspec.yaml.
Apparently VSCode extension subsystem somehow interferes with Flutter dependency manager.

All 26 comments

Hi @agordeev πŸ‘‹
Thanks for opening an issue!

Can you please provide a link to a sample app in which the command fails? I am unable to reproduce locally in various flutter projects.

Thanks! πŸ‘

Closing for now but feel free to comment with additional details/reproduction steps and I"m happy to continue the conversation πŸ‘

Unfortunately, I'm unable to share the project as it is a proprietary. The issue does not appear when I try to use on your examples from this repo.

VSCode dev tools console outputs this:
Screenshot 2019-11-14 at 09 11 30

Removing extension's folder from /users/%myname%/.vscode/extensions during reinstall didn't help neither.

Hmm it looks like the error is coming from within VSCode and not the bloc extension itself. I’ll try to investigate this further. In the meantime if you’re able to put together a sample app that reproduces the issue it would be awesome! Thanks πŸ‘

Looks like this is exactly the same issue as this one: https://github.com/shanalikhan/code-settings-sync/issues/745

I've tried to disable all the extensions except of Bloc, but that didn't help

@agordeev any updates? Have you tried a reinstall of VSCode?

No updates.
I haven't. It's too radical :)

Haha might be good in case something got corrupt πŸ˜›

I'm going to close this for now. The issue still persist and I don't know how to fix it. Hopefully someone will provide more details how to fix or reproduce it, then we can reopen

@agordeev can you re-test with v2.1.0 of the vscode extension? I updated the vscode extension dependencies and bundled the extension via webpack.

Nope, still the same error :(

😒 I was hoping that would've helped. Do you think you'll have time to try to create a sample project which reproduces the problem?

I managed to fix the issue by simply replacing any version to actual version or a blank space:

equatable: any

to this:

equatable: ^1.0.1

or even

equatable:

in pubspec.yaml.
Apparently VSCode extension subsystem somehow interferes with Flutter dependency manager.

hmm very strange πŸ€”

Thanks for sharing, I'll try to reproduce this and see if I can improve anything in the extension.

I doubt this is something in extension

Tried reproducing the issue and still nothing 😞

Closing for now since you've figured out how to resolve it on your side and it doesn't appear to be related to the bloc extension as you pointed out πŸ‘

I had the same problem and I fixed manually by editing the package.json file of the extension to

main": "./dist/extension.js" from ("./out/extension.js") . Hope it helps.

Until yesterday everything was working, most probably an upgrade broke something.

@andreacimino thanks for reporting this! Just fixed and published v3.0.1

image
image
Same problem on v3.0.1.

@JeasonL thanks for reporting this. @andreacimino are you also experiencing the same issue on v3.0.1?

I will try to install from scratch and will let you know (I am using still my modified version).

Here works fine.

@JeasonL are you able to provide more information or reproduction steps? Are you using Windows or MacOS? I am also unable to reproduce this but it sounds like you're running into the same issue as @agordeev.

The error happens to me because i am running on flutter 1.9.1 and bloc 2.1.0 because can't upgrade flutter yet(an amalyzer wear error under investigating). When the extention get automatic updated to version 3.0 the errors appears. I fixes by just downgrade extenxion. Hope that help somebody. Sorry for my bad English.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

komapeb picture komapeb  Β·  3Comments

RobPFarley picture RobPFarley  Β·  3Comments

rsnider19 picture rsnider19  Β·  3Comments

wheel1992 picture wheel1992  Β·  3Comments

ricktotec picture ricktotec  Β·  3Comments