nxrocks: [Bug] nx-flutter: inferred tasks aren't working

Plugin Name

create-nx-flutter

Nx Report

Node : 20.2.0 OS : darwin-arm64 npm : 9.6.6

nx (global) : 19.2.0 nx : 19.2.0 @nx/js : 19.2.0 @nx/workspace : 19.2.0 @nx/devkit : 19.2.0 @nrwl/tao : 19.2.0 typescript : 5.4.5

Registered Plugins: @nxrocks/nx-flutter

Community plugins: @nxrocks/nx-flutter : 9.0.2

Expected Behaviour

running

nx run-many -t test

should run tests on all flutter modules

  • dependencies between flutter modules should show up in the graph

Actual Behaviour

this is what happens

 NX   Successfully ran target test for 0 projects (20ms)

despite having projects in the workspace.

Steps to reproduce the behaviour

# create the workspace
npx create-nx-workspace@latest

# enter the workspace
cd the-workspace

# install nx-flutter plugin
npm install @nxrocks/nx-flutter --save-dev

# create a flutter project
npx nx g @nxrocks/nx-flutter:project 

# try running tests or any other command supported by nx-flutter
nx run-many -t test

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26 (14 by maintainers)

Commits related to this issue

Most upvoted comments

OK, the problem is now fixed.

Simply update the plugin to latest version (v9.2.0) and you should be good. Tested on your repro project above.

Here you go

https://github.com/denny99/nxrocks

pnpm i or npm i. Does not matter.

nx clean flutter-app will result in no target found.

The NX UI in Webstorm does not show any targets either

image

Thanks for the updates.

Is it expected for build-aar to not run in flutter modules? (it only tried to run on the app module which doesn’t have android libraries)

build-aar is only available when building for android platform.

(is there a way to specify if I want to use FVM or not via environmental flag? it would be useful to disable FVM on CI)

Right now, no. fvm is automatically used (instead of regular flutter) when it is found on the path. This is not configurable at the moment, but I agree, this can/should be configurable.

In the meantime, if you don’t have fvm on your CI/CD, but just regular flutter binary, it should be good already

Hi @danielesegato

Thanks for your response. I will have a closer look this weekend and let you know.

Stay tuned