Skip to content

fix: dart_frog build in a pub workspace (dart ^3.5) #1518

@Leptopoda

Description

@Leptopoda

Description

dart_frog build fails when run in a pub workspace package.
The issue seems to be that a pub workspace will only generate one global pbspec.lock file for the entire repository. Therefore, the post gen hook of the dart_frog_prod_server mason module fails.

 dart_frog build 
✓ Installing dependencies (3.4s)
✓ Bundling sources (0.2s)
An exception occurred while executing hook:REDACTED/.mason-cache/bundled/dart_frog_prod_server_0.1.0+1_8f9e5f00a1ad5ac6fe64824ffeb33163fed9b0ba/hooks/pre_gen.dart.
Error: PathNotFoundException: Cannot open file, path = 'REDACTED/packages/api/pubspec.lock' (OS Error: No such file or directory, errno = 2)

Steps To Reproduce

  1. create a dart pub workspace mono repo
  2. cd packages/api (the package our server code is living in)
  3. dart_frog build

Expected Behavior

dart_frog manages to build the server code.

Additional Context

For reference, pub workspaces are the new dart native mono repo management, which is currently in preview since dart 3.5.
More info at: https://flutter.dev/go/pub-workspace

Metadata

Metadata

Assignees

Labels

bugSomething isn't working as expectedp2Important issues not at the top of the work list

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions