melos icon indicating copy to clipboard operation
melos copied to clipboard

fix: Unclean error message with no reference to specific file

Open solshark opened this issue 7 months ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues.

Version

6.3.2

Description

It's hard to create reproduction. I have huge monorepo. For some reason melos bootstrap and melos clean stopped to work.

I cannot identify issue. I tried to lookup (with script) every yaml file for line #4, tried (via script) load and parse yaml file and everything seems good.

I believe error message should refer to corrupted file.

 melos clean
Cleaning workspace...
Unhandled exception:
ParsedYamlException: line 4, column 1: Expected ':'.
  â•·
4 │
  │ ^
  ╵
#0      checkedYamlDecode (package:checked_yaml/checked_yaml.dart:32:5)
#1      new Pubspec.parse (package:pubspec_parse/src/pubspec.dart:185:7)
#2      new PubspecOverrides.parse (package:melos/src/common/pubspec_overrides.dart:11:29)
#3      mergeMelosPubspecOverrides (package:melos/src/commands/bootstrap.dart:493:26)
#4      _CleanMixin._cleanPackage (package:melos/src/commands/clean.dart:46:31)
<asynchronous suspension>
#5      Future.wait.<anonymous closure> (dart:async/future.dart:528:21)
<asynchronous suspension>
#6      _CleanMixin.clean.<anonymous closure> (package:melos/src/commands/clean.dart:17:9)
<asynchronous suspension>
#7      _Melos._runLifecycle (package:melos/src/commands/runner.dart:144:7)
<asynchronous suspension>
#8      CleanCommand.run (package:melos/src/command_runner/clean.dart:21:5)
<asynchronous suspension>
#9      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#10     MelosCommandRunner.runCommand (package:melos/src/command_runner.dart:80:5)
<asynchronous suspension>
#11     melosEntryPoint (package:melos/src/command_runner.dart:133:5)
<asynchronous suspension>

Steps to reproduce

Complex monorepo, cannot share.

Expected behavior

Melos should print file name it cannot parse.

Screenshots

No response

Additional context and comments

No response

Other

  • [ ] I'm interested in working on a PR for this.

solshark avatar Apr 17 '25 11:04 solshark

Maybe you could try to run yamllint on your files? https://yamllint.readthedocs.io/en/stable/

Something like:

find . -name "*.yaml" -exec yamllint  {} +

spydon avatar Apr 17 '25 11:04 spydon

I had this same issue, when I was switching Flutter versions. Turns out deleting the pubspec_overrides.yaml files fixed it, and then melos bs worked.

slightfoot avatar Jun 18 '25 12:06 slightfoot

Happening to me as well - none of the above fixes work

benhawkinsicon avatar Jul 15 '25 19:07 benhawkinsicon

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar Aug 12 '25 20:08 github-actions[bot]

Happening to me as well - none of the above fixes work

Which version of Melos are you using @benhawkinsicon ?

spydon avatar Aug 12 '25 20:08 spydon

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar Sep 09 '25 22:09 github-actions[bot]