Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance of 'HookRunException' when creating new project fix: #470

Closed
ghost opened this issue Jul 22, 2022 · 9 comments
Closed

Instance of 'HookRunException' when creating new project fix: #470

ghost opened this issue Jul 22, 2022 · 9 comments
Assignees

Comments

@ghost
Copy link

ghost commented Jul 22, 2022

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.

@ghost ghost added the bug Something isn't working as expected label Jul 22, 2022
@felangel
Copy link
Contributor

felangel commented Jul 22, 2022

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 felangel self-assigned this Jul 22, 2022
@felangel felangel added question waiting for response Waiting for follow up labels Jul 22, 2022
@ghost
Copy link
Author

ghost commented Jul 22, 2022

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.

@lazicah
Copy link

lazicah commented Aug 28, 2022

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
Copy link

lazicah commented Sep 4, 2022

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

@felangel
Copy link
Contributor

felangel commented Sep 5, 2022

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

@ghost
Copy link
Author

ghost commented Sep 6, 2022

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.

@felangel
Copy link
Contributor

felangel commented Sep 7, 2022

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 felangel closed this as completed Sep 7, 2022
@felangel felangel removed bug Something isn't working as expected waiting for response Waiting for follow up labels Sep 7, 2022
@lazicah
Copy link

lazicah commented Sep 7, 2022

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
Copy link

lazicah commented Sep 7, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants