invertase / invertase/melos

fix: `sdkPath` is not working when flutter is not on the global path

Open
#616 32 comments 7 reactions 0 assignees View on GitHub
bug type: accepted
Dominant language
Dart
Stars
1.5k
Forks
259
Avg merge
2h 57m
Merged PRs (30d)
21

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues.

### Version

\>=3.2.0

### Description

Hi,

I use fvm to manage my various Flutter versions and until melos version 3.1.1 I had no particular problem with using the sdkPath option in my melos.yml configuration file.
```yaml
sdkPath: .fvm/flutter_sdk
```
Since I updated melos on 3.2.0 (same problem on 3.4.0) this option no longer works with the message `The Flutter SDK is not available.`.

### Steps to reproduce

1. Install fvm and use the version 3.16.3 of Flutter on your current project (same problem with 3.1.6 for example)
2. Install melos 3.2.0 (or above)
3. add `sdkPath: .fvm/flutter_sdk` on `melos.yaml`
4. Run melos bs
5. SDK not found.

```
PS C:\Work\my_project> melos bs
The Flutter SDK is not available.
PS C:\Work\my_project>
```

### Expected behavior

The specified SDK path has been found and the command is running.

### Screenshots

_No response_

### Additional context and comments

I've looked through the PR and searched the entire project (on tag 3.2.0 and melos-latest), but I can't figure out what caused the problem or how to solve it.

I work on Windows 11 (without WSL), but like I said, everything work fine with melos 3.1.1.

I tried mmany configuration
- melos 3.1.1
- Flutter 3.10.6 = OK
- Flutter 3.13.9 = OK
- Flutter 3.16.3 = OK
- melos 3.2.0
- Flutter 3.10.6 = KO
- Flutter 3.13.9 = KO
- Flutter 3.16.3 = KO
- melos 3.4.0
- Flutter 3.10.6 = KO
- Flutter 3.13.9 = KO
- Flutter 3.16.3 = KO

I also tried to use the env variable `MELOS_SDK_PATH`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with sdkPath in melos.yml and the melos bs command on Windows, then compare SDK-path handling between versions 3.1.1 and 3.2.0. The work is done when the configured .fvm/flutter_sdk path is recognized without Flutter on the global PATH and the command runs successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.