mason_bricks icon indicating copy to clipboard operation
mason_bricks copied to clipboard

Unable to execute hook pre_gen.dart fix:

Open wednesdei opened this issue 2 years ago • 1 comments

model

  • [ x ] model

Description \models> mason make model ? What is the models name? (model) users ? Does this model have a copyWith method? (Y/n) Yes ? Does this model use equatable? (Y/n) Yes ? Does this model use json? (Y/n) Yes Unable to execute hook: C:/Users/anypo/AppData/Local/Mason/Cache/hosted/registry.brickhub.dev/model_0.3.7\hooks\pre_gen.dart. Error: Unexpected type 'invalid-type' of a map spread entry. Expected 'dynamic' or a Map. ...context.vars, ^

Steps To Reproduce

See above

Expected Behavior It creates the model.

Screenshots N/A

Additional Context I'm not sure what I'm doing wrong, but it used to work, any ideas?

wednesdei avatar Jul 21 '22 20:07 wednesdei

Hey @wednesdei 👋

Thanks for opening this issue!

Could you let me know what Mason & Flutter version you are using so I can try to replicate this? Thanks!!

LukeMoody01 avatar Jul 23 '22 03:07 LukeMoody01

Closing this PR as stale. Please feel free to re-open this issue if you have more info!

LukeMoody01 avatar Oct 01 '22 06:10 LukeMoody01

@LukeMoody01 Same issue here, just with the feature_brick

Mason version

(base) admin@Kris---mac features % mason --version
0.1.0-dev.51

Flutter version

(base) admin@Kris---mac features % flutter --version
Flutter 3.16.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision db7ef5bf9f (6 weeks ago) • 2023-11-15 11:25:44 -0800
Engine • revision 74d16627b9
Tools • Dart 3.2.0 • DevTools 2.28.2

Dart version

(base) admin@Kris---mac features % dart --version
Dart SDK version: 3.2.0 (stable) (Tue Nov 14 18:26:59 2023 +0000) on "macos_arm64"

Using the latest feature_brick bricks: hello: 0.1.0+1 annoying_analysis_options: ^0.0.1 feature_brick: ^0.6.2

mason make feature_brick --feature_name login --state_management cubit

Error:

(base) admin@Kris---mac features % mason make feature_brick --feature_name login --state_management cubit

✓ Compiled pre_gen.dart (2.7s)
An exception occurred while executing hook: /Users/admin/.mason-cache/hosted/registry.brickhub.dev/feature_brick_0.6.2/hooks/pre_gen.dart.
Error: Unable to spawn isolate: Can't load Kernel binary: Invalid kernel binary format version.

I tried this workaround:

(base) admin@Kris---mac features % which flutter  
/opt/homebrew/Caskroom/flutter/3.10.5/flutter/bin/flutter

and after that (base) admin@Kris---mac features % rm -rf /opt/homebrew/Caskroom/flutter/3.10.5/flutter/bin/cache/flutter_tools.stamp

But issue remains

radikris avatar Dec 27 '23 10:12 radikris

@LukeMoody01 Same issue here, just with the feature_brick

Mason version

(base) admin@Kris---mac features % mason --version
0.1.0-dev.51

Flutter version

(base) admin@Kris---mac features % flutter --version
Flutter 3.16.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision db7ef5bf9f (6 weeks ago) • 2023-11-15 11:25:44 -0800
Engine • revision 74d16627b9
Tools • Dart 3.2.0 • DevTools 2.28.2

Dart version

(base) admin@Kris---mac features % dart --version
Dart SDK version: 3.2.0 (stable) (Tue Nov 14 18:26:59 2023 +0000) on "macos_arm64"

Using the latest feature_brick bricks: hello: 0.1.0+1 annoying_analysis_options: ^0.0.1 feature_brick: ^0.6.2

mason make feature_brick --feature_name login --state_management cubit

Error:

(base) admin@Kris---mac features % mason make feature_brick --feature_name login --state_management cubit

✓ Compiled pre_gen.dart (2.7s)
An exception occurred while executing hook: /Users/admin/.mason-cache/hosted/registry.brickhub.dev/feature_brick_0.6.2/hooks/pre_gen.dart.
Error: Unable to spawn isolate: Can't load Kernel binary: Invalid kernel binary format version.

I tried this workaround:

(base) admin@Kris---mac features % which flutter  
/opt/homebrew/Caskroom/flutter/3.10.5/flutter/bin/flutter

and after that (base) admin@Kris---mac features % rm -rf /opt/homebrew/Caskroom/flutter/3.10.5/flutter/bin/cache/flutter_tools.stamp

But issue remains

I have the same issue, is there any solution already?

kovilevi98 avatar Dec 27 '23 11:12 kovilevi98