Skip to content

Improve diagnostic reporting on invalid analysis options #56943

Open
@MohammadNezarAldalati

Description

@MohammadNezarAldalati
  • I created a new flutter project, then I run dart analyze and got this error:
Internal error: Failed to handle request: analysis.setAnalysisRoots
Null check operator used on a null value
#0      _LintConfig._parseYaml.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:analyzer/src/lint/config.dart:161:48)
#1      CastMap.forEach.<anonymous closure> (dart:_internal/cast.dart:286:8)
#2      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:633:13)
#3      CastMap.forEach (dart:_internal/cast.dart:285:13)
#4      MapView.forEach (dart:collection/maps.dart:347:10)
#5      _LintConfig._parseYaml.<anonymous closure>.<anonymous closure> (package:analyzer/src/lint/config.dart:155:54)
#6      CastMap.forEach.<anonymous closure> (dart:_internal/cast.dart:286:8)
#7      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:633:13)
#8      CastMap.forEach (dart:_internal/cast.dart:285:13)
#9      MapView.forEach (dart:collection/maps.dart:347:10)
#10     _LintConfig._parseYaml.<anonymous closure> (package:analyzer/src/lint/config.dart:144:46)
#11     _HashMap.forEach (dart:collection-patch/collection_patch.dart:153:15)
#12     MapView.forEach (dart:collection/maps.dart:347:10)
#13     _LintConfig._parseYaml (package:analyzer/src/lint/config.dart:117:16)
#14     new LintConfig.parseMap (package:analyzer/src/lint/config.dart:38:62)
#15     parseConfig (package:analyzer/src/lint/config.dart:15:25)
#16     AnalysisOptionsImplExtensions.applyOptions (package:analyzer/src/analysis_options/apply_options.dart:229:18)
#17     ContextBuilderImpl._createOptionsMap (package:analyzer/src/dart/analysis/context_builder.dart:210:15)
#18     ContextBuilderImpl.createContext (package:analyzer/src/dart/analysis/context_builder.dart:135:15)
#19     new AnalysisContextCollectionImpl (package:analyzer/src/dart/analysis/analysis_context_collection.dart:108:36)
#20     ContextManagerImpl._createAnalysisContexts.performContextRebuildGuarded.performContextRebuild (package:analysis_server/src/context_manager.dart:549:40)
<asynchronous suspension>
#21     ContextManagerImpl._createAnalysisContexts.performContextRebuildGuarded (package:analysis_server/src/context_manager.dart:694:11)
<asynchronous suspension>
#22     _CancellingTaskQueue.queue.<anonymous closure> (package:analysis_server/src/context_manager.dart:978:15)
<asynchronous suspension>
#23     ContextManagerImpl.setRoots (package:analysis_server/src/context_manager.dart:364:5)
<asynchronous suspension>
#24     LegacyAnalysisServer.setAnalysisRoots (package:analysis_server/src/legacy_analysis_server.dart:793:9)
<asynchronous suspension>
#25     AnalysisSetAnalysisRootsHandler.handle (package:analysis_server/src/handler/legacy/analysis_set_analysis_roots.dart:46:7)
<asynchronous suspension>
#26     LegacyAnalysisServer.handleRequest.<anonymous closure>.<anonymous closure> (package:analysis_server/src/legacy_analysis_server.dart:577:11)
<asynchronous suspension>
#27     OperationPerformanceImpl.runAsync (package:analyzer/src/util/performance/operation_performance.dart:174:14)
<asynchronous suspension>
#28     LegacyAnalysisServer.handleRequest.<anonymous closure> (package:analysis_server/src/legacy_analysis_server.dart:558:7)
<asynchronous suspension>


null
[RequestError code: SERVER_ERROR, message: Null check operator used on a null value]

General info

  • Dart 3.5.3 (stable) (Wed Sep 11 16:22:47 2024 +0000) on "macos_arm64"
  • on macos / Version 14.6.1 (Build 23G93)
  • locale is en-OM

Project info

  • sdk constraint: '^3.5.3'
  • dependencies: cupertino_icons, flutter, flutter_riverpod, riverpod
  • dev_dependencies: custom_lint, flutter_lints, flutter_test, riverpod_lint

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestanalyzer-analysis-optionsarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-uxdevexp-warningIssues with the analyzer's Warning codestype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions