Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspaces bundle all assets from all packages #4473

Open
josh-burton opened this issue Dec 16, 2024 · 0 comments · May be fixed by flutter/flutter#160443
Open

Workspaces bundle all assets from all packages #4473

josh-burton opened this issue Dec 16, 2024 · 0 comments · May be fixed by flutter/flutter#160443
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@josh-burton
Copy link

Environment

  • Dart version: 3.6.0
  • MacOS
  • Are you using the Chinese community mirror or a corporate firewall? NO

Problem

When using the new pub workspaces, I've found a bug where assets from all packages are bundled in the built app, rather than assets from just the packages that the Flutter app depends on.

This seems to occur when packages in the workspace depend on a common shared package - in this case one called base.

Steps to reproduce

Given a Flutter monorepo that uses pub workspaces in this setup:

  • base - a Flutter package with an asset
  • included_package - a Flutter package with an asset that depends on base
  • excluded_package - a Flutter package with an asset that depends on base
  • app - a Flutter app that depends on ONLY included_package

Build the app via flutter build web in the app package.

Expected results

A Flutter app is built containing only the assets from included_package.

Actual results

A Flutter app is built containing the assets from all packages.

Code sample

Code sample See this Github repo for a sample: https://github.com/josh-burton/flutter_workspace_assets_bug

Also filed in Flutter repo: flutter/flutter#160142

@sigurdm sigurdm added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants