Skip to content

[flutter_tools] YamlException "Expected a key while parsing a block mapping" parsing localizations #123148

@christopherfujino

Description

@christopherfujino

On beta/3.9.0-1.0.pre.2
With command: flutter gen-l10n

YamlException: Error on line 4, column 26: Expected a key while parsing a block mapping.
  ╷
4 │ template-arb-file: {name}_en.arb
  │                          ^
  ╵
at Parser._parseBlockMappingKey(parser.dart:456)
at Parser._stateMachine(parser.dart:100)
at Parser.parse(parser.dart:61)
at Loader._loadMapping(loader.dart:175)
at Loader._loadNode(loader.dart:92)
at Loader._loadDocument(loader.dart:68)
at Loader.load(loader.dart:60)
at loadYamlDocument(yaml.dart:72)
at loadYamlNode(yaml.dart:57)
at parseLocalizationsOptions(localizations_utils.dart:439)
at GenerateLocalizationsCommand.runCommand(generate_localizations.dart:232)
at FlutterCommand.verifyThenRunCommand(flutter_command.dart:1465)
at <asynchronous gap>(async)
at FlutterCommand.run.<anonymous closure>(flutter_command.dart:1301)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at CommandRunner.runCommand(command_runner.dart:212)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand.<anonymous closure>(flutter_command_runner.dart:288)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand(flutter_command_runner.dart:236)
at <asynchronous gap>(async)
at run.<anonymous closure>.<anonymous closure>(runner.dart:64)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at main(executable.dart:91)
at <asynchronous gap>(async)

This actually seems like a reasonably helpful error message, I think the action item here should be ensuring this is toolexit rather and not hitting crash reporting.

Metadata

Metadata

Labels

P2Important issues not at the top of the work listtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions