very_good_cli icon indicating copy to clipboard operation
very_good_cli copied to clipboard

Instance of 'HookRunException' when creating new project fix:

Open wednesdei opened this issue 3 years ago • 2 comments

Description I'm trying to use very_good create myproject and it generates an unhandled exception.

Steps To Reproduce

  1. type very_good create myproject

Expected Behavior It creates the project

Screenshots Added screenshot error

Additional Context I just started using mason, probably incorrectly, and it looks like I may have broke the vgv stuff. Any ideas? I tried to deactivate/reactivate and still no luck.

wednesdei avatar Jul 22 '22 04:07 wednesdei

Hi @wednesdei 👋 Thanks for opening an issue!

I'm unable to reproduce on MacOS but will check on Windows first thing in the morning. In the meantime I recommend trying to deactivate mason_cli and very_good_cli and reactivate very_good_cli:

dart pub global deactivate mason_cli
dart pub global deactivate very_good_cli

dart pub global activate mason_cli
dart pub global activate very_good_cli

Also, did you install mason_cli via pub or homebrew? If you did it via homebrew I highly recommend updating to ensure you have the latest version.

Let me know if that helps and sorry for the inconvenience!

felangel avatar Jul 22 '22 04:07 felangel

All good, no problem. I did try to deactivate, and reactivate, unfortunately it didn't fix it. I also tried a dart pub cache clean, flutter clean, and then try again with no success. I'm just trying to remember what I was doing before the issue started. I think I deleted a project folder, and did a pub cache clean/flutter clean. I'm not sure if that might have cause the issue, nothing else really stands out.

ghost avatar Jul 22 '22 13:07 ghost

I am also experiencing this issue.

very_good create totel --desc "Totel Cross-platform app" --org "com.totel.app" otel> ⠴ Bootstrapping... (1.3s)Unhandled exception: Unable to execute hook: pre_gen.dart. Error: 'HookContext' isn't a type. void run(HookContext context) { ^^^^^^^^^^^ GeneratorHooks._runHook (package:mason/src/hooks.dart:320:7) CreateCommand.run (package:very_good_cli/src/commands/create/create.dart:166:5)
CommandRunner.runCommand (package:args/command_runner.dart:209:13) VeryGoodCommandRunner.runCommand (package:very_good_cli/src/command_runner.dart:141:18) VeryGoodCommandRunner.run (package:very_good_cli/src/command_runner.dart:88:14)
main (file:///C:/Users/Lazarus/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/very_good_cli-0.7.13/bin/very_good.dart:5:24) ⠋ Bootstrapping... (1.0s)Unhandled exception: Unable to execute hook: pre_gen.dart. Error: 'HookContext' isn't a type. void run(HookContext context) { ^^^^^^^^^^^ GeneratorHooks._runHook (package:mason/src/hooks.dart:320:7) CreateCommand.run (package:very_good_cli/src/commands/create/create.dart:166:5)
CommandRunner.runCommand (package:args/command_runner.dart:209:13) VeryGoodCommandRunner.runCommand (package:very_good_cli/src/command_runner.dart:141:18) VeryGoodCommandRunner.run (package:very_good_cli/src/command_runner.dart:88:14)
main (file:///C:/Users/Lazarus/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/very_good_cli-0.7.13/bin/very_good.dart:5:24)

lazicah avatar Aug 28 '22 23:08 lazicah

Any solution yet @felangel ? I really need to get a project started

lazicah avatar Sep 04 '22 10:09 lazicah

@lazicah can you provide the output of flutter doctor -v?

felangel avatar Sep 05 '22 08:09 felangel

I haven't tried to use the very_good cli until today, and it is now working. I had to recently re-install VS Code, and I also re-installed the very_good cli. Looks like it all works now, I can close this out if that works for you, my issue disappeared.

ghost avatar Sep 06 '22 18:09 ghost

I'd recommend closing this for now if we don't have reproduction steps. I'm happy to reopen this if others are able to provide reproduction steps 👍

felangel avatar Sep 07 '22 14:09 felangel

Sorry @felangel for the late reply [√] Flutter (Channel stable, 3.0.4, on Microsoft Windows [Version 10.0.19041.928], locale en-US) • Flutter version 3.0.4 at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 85684f9300 (10 weeks ago), 2022-06-30 13:22:47 -0700 • Engine revision 6ba2af10bb • Dart version 2.17.5 • DevTools version 2.12.2

Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc3) • Android SDK at C:\Users\Lazarus\AppData\Local\Android\Sdk • Platform android-33, build-tools 31.0.0-rc3 • ANDROID_SDK_ROOT = C:\Users\Lazarus\AppData\Local\Android\sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174) • All Android licenses accepted.

[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.4) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community • Visual Studio Community 2019 version 16.9.31205.134 • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2) • Android Studio at C:\Program Files\Android\Android Studio1 • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] Android Studio (version 4.2) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)

[√] VS Code (version 1.71.0) • VS Code at C:\Users\Lazarus\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.48.0

[√] Connected device (4 available) • SM A135F (mobile) • 192.168.43.16:42355 • android-arm • Android 12 (API 31) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19041.928] • Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.102 • Edge (web) • edge • web-javascript • Microsoft Edge 104.0.1293.63

[√] HTTP Host Availability • All required HTTP hosts are available

• No issues found!

lazicah avatar Sep 07 '22 22:09 lazicah

When i try to create

very_good create toe ⠇ Bootstrapping... (1.6s)Unhandled exception: Unable to execute hook: pre_gen.dart. Error: 'HookContext' isn't a type. void run(HookContext context) { ^^^^^^^^^^^ GeneratorHooks._runHook (package:mason/src/hooks.dart:320:7) CreateCommand.run (package:very_good_cli/src/commands/create/create.dart:166:5) CommandRunner.runCommand (package:args/command_runner.dart:209:13) VeryGoodCommandRunner.runCommand (package:very_good_cli/src/command_runner.dart:141:18) VeryGoodCommandRunner.run (package:very_good_cli/src/command_runner.dart:88:14) main (file:///C:/Users/Lazarus/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/very_good_cli-0.7.13/bin/very_good.dart:5:24) ⠹ Bootstrapping... (1.1s)Unhandled exception: Unable to execute hook: pre_gen.dart. Error: 'HookContext' isn't a type. void run(HookContext context) { ^^^^^^^^^^^ GeneratorHooks._runHook (package:mason/src/hooks.dart:320:7) CreateCommand.run (package:very_good_cli/src/commands/create/create.dart:166:5) CommandRunner.runCommand (package:args/command_runner.dart:209:13) VeryGoodCommandRunner.runCommand (package:very_good_cli/src/command_runner.dart:141:18) VeryGoodCommandRunner.run (package:very_good_cli/src/command_runner.dart:88:14) main (file:///C:/Users/Lazarus/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/very_good_cli-0.7.13/bin/very_good.dart:5:24)

lazicah avatar Sep 07 '22 22:09 lazicah