build icon indicating copy to clipboard operation
build copied to clipboard

build_runner_core-9.3.0 seems to have "import 'dart:mirrors'" which is not supported in Dart runtime

Open swapnild499 opened this issue 4 months ago • 3 comments

dev_dependencies

I have build_runner: 2.4.15, which is internally dependent on build_runner_core-9.3.0, which shows having import 'dart: mirrors', which is blocking the run app.

Image Image

swapnild499 avatar Sep 12 '25 12:09 swapnild499

build_runner should not be compiled into your app--it is not a runtime dependency.

It should work to move build_runner and anything related from dependencies to dev_dependencies.

davidmorgan avatar Sep 12 '25 13:09 davidmorgan

@davidmorgan build_runner is included only under dev_dependencies, but when I run the app, it fails. While investigating, I queried for dart:mirrors and noticed that build_runner also appeared in the results. I’m not sure if this is the root cause, but wanted to check with you for clarity.

Image

swapnild499 avatar Sep 12 '25 15:09 swapnild499

I guess not, unless you have some package in dependencies that transitively pulls in build_runner.

You can try removing build_runner from your dev dependencies then flutter pub get and try again; you can check the resulting pubspec.lock file to be sure you don't have a transitive dependency on build_runner via some other package.

davidmorgan avatar Sep 12 '25 15:09 davidmorgan