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

Cause exception for dart migrate --skip-import-check #45285

Closed
bannzai opened this issue Mar 11, 2021 · 3 comments
Closed

Cause exception for dart migrate --skip-import-check #45285

bannzai opened this issue Mar 11, 2021 · 3 comments
Labels
area-migration (deprecated) Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool). crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash. nnbd-migration-not-affecting-google3 P2 A bug or feature request we're likely to work on

Comments

@bannzai
Copy link

bannzai commented Mar 11, 2021

Abstract

I got exception for dart migrate --skip-import-check.

History

These are the commands I was doing just before get an exception.

$ dart --version
$ dart pub outdated --mode=null-safety
$ dart pub upgrade --nullsafety freezed_annotation json_annotation riverpod firebase_core mockito package_info url_launcher firebase_messaging shared_preferences equatable flutter_hooks cloud_firestore flutter_svg firebase_analytics intl firebase_auth hooks_riverpod version firebase_crashlytics dotted_border in_app_review cupertino_icons freezed
$ dart pub get
$ dart migrate # I got another error and recommended to execute `dart migrate` with --skip-import-check
$ dart migrate --skip-import-check
`$ dart migrate --skip-import-check

$ dart migrate --skip-import-check
Migrating /Users/user/ghq/github.com/Pilll

See https://dart.dev/go/null-safety-migration for a migration guide.

Analyzing project...
[-------------------------------------------------------------------------------------------------------------------|[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[--------------------------------------------------------------------------------------------------------------------[------------------------------------------------------------------------------------------------------------------------------------|]Warning: package has unmigrated dependencies.

Continuing due to the presence of --skip-import-check. To see a complete
list of the unmigrated dependencies, re-run without the --skip-import-check
flag.

No analysis issues found.

Generating migration suggestions...
[-------------------------------------------------------------| ]Aborting migration due to an exception. This most likely is due to a
bug in the migration tool. Please consider filing a bug report at:

https://github.com/dart-lang/sdk/issues/new
Please include the SDK version (2.12.0) in your bug report.

To attempt to perform migration anyway, you may re-run with
--ignore-exceptions.

Exception details:

Invalid argument(s): dynamic is an unexpected type at offset 1544 in /Users/user/ghq/github.com/Pilll/lib/domain/diary/post_diary_page.dart (_postDiaryStoreProvider(date).state)

#0 DecoratedClassHierarchy._getInterfaceType (package:nnbd_migration/src/decorated_class_hierarchy.dart:121:5)
#1 DecoratedClassHierarchy.asInstanceOf (package:nnbd_migration/src/decorated_class_hierarchy.dart:34:12)
#2 EdgeBuilder.getOrComputeElementType (package:nnbd_migration/src/edge_builder.dart:270:18)
#3 EdgeBuilder._handlePropertyAccess (package:nnbd_migration/src/edge_builder.dart:2997:20)
#4 EdgeBuilder.visitPropertyAccess (package:nnbd_migration/src/edge_builder.dart:1451:12)
#5 PropertyAccessImpl.accept (package:analyzer/src/dart/ast/ast.dart:8448:49)
#6 EdgeBuilder._dispatch (package:nnbd_migration/src/edge_builder.dart:2207:24)
#7 EdgeBuilder._handleAssignment (package:nnbd_migration/src/edge_builder.dart:2329:20)
#8 EdgeBuilder._handleInvocationArguments (package:nnbd_migration/src/edge_builder.dart:2934:7)
#9 EdgeBuilder.visitMethodInvocation (package:nnbd_migration/src/edge_builder.dart:1296:24)
#10 MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7186:49)
#11 EdgeBuilder._dispatch (package:nnbd_migration/src/edge_builder.dart:2207:24)
#12 EdgeBuilder._handleAssignment (package:nnbd_migration/src/edge_builder.dart:2329:20)
#13 EdgeBuilder.visitVariableDeclarationList (package:nnbd_migration/src/edge_builder.dart:1924:11)
#14 VariableDeclarationListImpl.accept (package:analyzer/src/dart/ast/ast.dart:10655:15)
#15 EdgeBuilder._dispatch (package:nnbd_migration/src/edge_builder.dart:2207:24)
#16 EdgeBuilder.visitNode (package:nnbd_migration/src/edge_builder.dart:1340:9)
#17 GeneralizingAstVisitor.visitStatement (package:analyzer/dart/ast/visitor.dart:517:39)
#18 GeneralizingAstVisitor.visitVariableDeclarationStatement (package:analyzer/dart/ast/visitor.dart:589:7)
#19 VariableDeclarationStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:10705:15)
#20 EdgeBuilder._dispatch (package:nnbd_migration/src/edge_builder.dart:2207:24)
#21 EdgeBuilder.visitNode (package:nnbd_migration/src/edge_builder.dart:1340:9)
#22 GeneralizingAstVisitor.visitStatement (package:analyzer/dart/ast/visitor.dart:517:39)
#23 GeneralizingAstVisitor.visitBlock (package:analyzer/dart/ast/visitor.dart:165:31)
#24 BlockImpl.accept (package:analyzer/src/dart/ast/ast.dart:1083:49)
#25 EdgeBuilder._dispatch (package:nnbd_migration/src/edge_builder.dart:2207:24)
#26 EdgeBuilder.visitNode (package:nnbd_migration/src/edge_builder.dart:1340:9)
#27 GeneralizingAstVisitor.visitFunctionBody (package:analyzer/dart/ast/visitor.dart:324:45)
#28 GeneralizingAstVisitor.visitBlockFunctionBody (package:analyzer/dart/ast/visitor.dart:168:55)
#29 BlockFunctionBodyImpl.accept (package:analyzer/src/dart/ast/ast.dart:1038:49)
#30 EdgeBuilder._dispatch (package:nnbd_migration/src/edge_builder.dart:2207:24)
#31 EdgeBuilder._handleExecutableDeclaration (package:nnbd_migration/src/edge_builder.dart:2488:7)
#32 EdgeBuilder.visitMethodDeclaration (package:nnbd_migration/src/edge_builder.dart:1243:5)
#33 MethodDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7033:49)
#34 EdgeBuilder._dispatch (package:nnbd_migration/src/edge_builder.dart:2207:24)
#35 EdgeBuilder._dispatchList (package:nnbd_migration/src/edge_builder.dart:2229:7)
#36 EdgeBuilder.visitClassOrMixinOrExtensionDeclaration (package:nnbd_migration/src/edge_builder.dart:607:7)
#37 EdgeBuilder.visitClassDeclaration (package:nnbd_migration/src/edge_builder.dart:574:5)
#38 ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:1536:49)
#39 EdgeBuilder._dispatch (package:nnbd_migration/src/edge_builder.dart:2207:24)
#40 EdgeBuilder.visitNode (package:nnbd_migration/src/edge_builder.dart:1340:9)
#41 GeneralizingAstVisitor.visitCompilationUnit (package:analyzer/dart/ast/visitor.dart:202:51)
#42 CompletenessTracker.visitCompilationUnit. (package:nnbd_migration/src/utilities/completeness_tracker.dart:52:24)
#43 PermissiveModeVisitor.reportExceptionsIfPermissive (package:nnbd_migration/src/utilities/permissive_mode.dart:26:24)
#44 CompletenessTracker.visitCompilationUnit (package:nnbd_migration/src/utilities/completeness_tracker.dart:43:5)
#45 CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2134:49)
#46 NullabilityMigrationImpl.processInput (package:nnbd_migration/src/nullability_migration_impl.dart:244:12)
#47 NonNullableFix.processUnit (package:nnbd_migration/src/front_end/non_nullable_fix.dart:164:15)
#48 _FixCodeProcessor.runLaterPhases. (package:nnbd_migration/migration_cli.dart:1154:19)
#49 _FixCodeProcessor.runLaterPhases. (package:nnbd_migration/migration_cli.dart:1152:28)
#50 _FixCodeProcessor.processResources (package:nnbd_migration/migration_cli.dart:1081:30)

#51 _FixCodeProcessor.runLaterPhases (package:nnbd_migration/migration_cli.dart:1152:5)

#52 MigrationCliRunner.run (package:nnbd_migration/migration_cli.dart:749:24)

#53 MigrateCommand.run (package:nnbd_migration/migration_cli.dart:185:7)

#54 CommandRunner.runCommand (package:args/command_runner.dart:196:13)

#55 DartdevRunner.runCommand (package:dartdev/dartdev.dart:199:18)

#56 runDartdev (package:dartdev/dartdev.dart:53:16)

#57 main (file:///opt/s/w/ir/cache/builder/src/third_party/dart/pkg/dartdev/bin/dartdev.dart:11:3)

Environment

`$ dart --version`
$ dart --version
Dart SDK version: 2.12.0 (stable) (Thu Feb 25 19:50:53 2021 +0100) on "macos_x64"
`$ flutter doctor -v`
$ flutter doctor -v
flutter doctor -v                                                                                                                                                          
[✓] Flutter (Channel stable, 2.0.1, on Mac OS X 10.15.7 19H15 darwin-x64, locale ja-JP)
    • Flutter version 2.0.1 at /Users/user/ghq/github.com/flutter/flutter
    • Framework revision c5a4b4029c (7 days ago), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0
    • ANDROID_HOME = /Users/user/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.54.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.9.1

[✓] Connected device (2 available)
    • iPhone 12 Pro Max (mobile) • 903AE2DC-EF4D-4A20-AA89-3D4D66EAC866 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 88.0.4324.192
@a-siva a-siva added the area-migration (deprecated) Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool). label Mar 11, 2021
@stereotype441
Copy link
Member

@bannzai Thanks for the bug report! Did you try the tool's suggestion of running with --ignore-exceptions? If so, did that work?

@stereotype441 stereotype441 added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Mar 18, 2021
@bannzai
Copy link
Author

bannzai commented Mar 30, 2021

Oh, I missed the notification.

Did you try the tool's suggestion of running with --ignore-exceptions?

Yes, I did it shortly after I created this issue. And it works as expected.

@stereotype441 stereotype441 added P2 A bug or feature request we're likely to work on and removed P1 A high priority bug; for example, a single project is unusable or has many test failures labels Aug 4, 2021
@srawlins srawlins added crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash. nnbd-migration-not-affecting-google3 labels Aug 23, 2022
@stereotype441
Copy link
Member

As of 1c7fe71, the null safety migration tool has been removed from active development and retired. No further work on the tool is planned.

If you still need help, or you believe this issue has been closed in error, please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-migration (deprecated) Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool). crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash. nnbd-migration-not-affecting-google3 P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

4 participants