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

Target dart2js failed: ProcessException: Process exited abnormally with exit code 253: Internal Error: The compiler crashed when compiling this element. The compiler is broken. #55096

Open
bvversoz opened this issue Mar 5, 2024 · 8 comments
Assignees
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. web-dart2js

Comments

@bvversoz
Copy link

bvversoz commented Mar 5, 2024

OS: Maco OS Sonoma version: 14.2.1
Dart SDK Version: 3.0.0-75.0.dev (dev) (Thu Dec 29 16:50:26 2022 -0800) on "macos_x64"
the entire message you see here (including the full stack trace
below as well as the source location above).

The compiler crashed: Error reading '.dart_tool/flutter_build/c517bab813172500a4c587e785642942/app.dill' (No such file or directory)
Command: /Users/benversoza/Development/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /Users/benversoza/Development/flutter/bin/cache/dart-sdk/bin/snapshots/dart2js.dart.snapshot
--platform-binaries=/Users/benversoza/Development/flutter/bin/cache/flutter_web_sdk/kernel --invoker=flutter_tool -Ddart.vm.product=true
-DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/c52b3033eca6a65f504753356fb3ff49f110bde6/ -DFLUTTER_WEB_AUTO_DETECT=false -DFLUTTER_WEB_USE_SKIA=false --native-null-assertions --no-source-maps -O4 -o
/Users/benversoza/Documents/Fresh_Start/FireBaseGettingStarted/lib/.dart_tool/flutter_build/c517bab813172500a4c587e785642942/main.dart.js
/Users/benversoza/Documents/Fresh_Start/FireBaseGettingStarted/lib/.dart_tool/flutter_build/c517bab813172500a4c587e785642942/app.dill
#0 RunResult.throwException (package:flutter_tools/src/base/process.dart:127:5)
#1 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:326:19)

#2 Dart2JSTarget.build (package:flutter_tools/src/build_system/targets/web.dart:195:5)

#3 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:875:9)

#4 Future.wait. (dart:async/future.dart:524:21)

#5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)

#6 Future.wait. (dart:async/future.dart:524:21)

#7 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)

#8 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:642:16)

#9 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:91:34)

#10 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:237:5)

#11 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1394:27)

#12 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)

#13 CommandRunner.runCommand (package:args/command_runner.dart:212:13)

#14 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:360:9)

#15 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)

#16 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:300:5)

#17 run.. (package:flutter_tools/runner.dart:119:9)

#18 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)

#19 main (package:flutter_tools/executable.dart:94:3)

Compiling lib/main.dart for the Web... 26.0s
Error: Failed to compile application for the Web.

@bvversoz bvversoz changed the title Target dart2js failed: ProcessException: Process exited abnormally with exit code 253: .dart_tool/flutter_build/c517bab813172500a4c587e785642942/app.dill: Internal Error: The compiler crashed when compiling this element. The compiler is broken. Target dart2js failed: ProcessException: Process exited abnormally with exit code 253: Internal Error: The compiler crashed when compiling this element. The compiler is broken. Mar 5, 2024
@lrhn
Copy link
Member

lrhn commented Mar 5, 2024

If the title is the actual error message, then this does sound like a bug in dart2js.

@lrhn lrhn added web-dart2js area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. labels Mar 5, 2024
@sigmundch
Copy link
Member

Thanks for filing the issue!

We need a bit more info to investigate. I believe the stack trace above is an error from the flutter tool when it gets in a bad state after the compilation failed. Could you share with us the stack trace from the dart2js compiler (what comes after "The compiler is broken" which you shared in the title)? Or do you have a small example code that reproduces the crash that we can use to debug?

Thanks!

@sigmundch sigmundch added the needs-info We need additional information from the issue author (auto-closed after 14 days if no response) label Mar 5, 2024
@bvversoz
Copy link
Author

bvversoz commented Mar 6, 2024

This is what I get when trying to build to web.

flutter build web --web-renderer html

Target dart2js failed: ProcessException: Process exited abnormally with exit code 253:
.dart_tool/flutter_build/c517bab813172500a4c587e785642942/app.dill:
Internal Error: The compiler crashed when compiling this element.
The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

  • the name and version of your operating system,

  • the Dart SDK build number (3.4.0-190.0.dev), and

  • the entire message you see here (including the full stack trace
    below as well as the source location above).

The compiler crashed: Error reading '.dart_tool/flutter_build/c517bab813172500a4c587e785642942/app.dill' (No such file or directory)
Command: /Users/benversoza/Development/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /Users/benversoza/Development/flutter/bin/cache/dart-sdk/bin/snapshots/dart2js.dart.snapshot
--platform-binaries=/Users/benversoza/Development/flutter/bin/cache/flutter_web_sdk/kernel --invoker=flutter_tool -Ddart.vm.product=true
-DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/c52b3033eca6a65f504753356fb3ff49f110bde6/ -DFLUTTER_WEB_AUTO_DETECT=false -DFLUTTER_WEB_USE_SKIA=false --native-null-assertions --no-source-maps -O4 -o
/Users/benversoza/Documents/Fresh_Start/FireBaseGettingStarted/lib/.dart_tool/flutter_build/c517bab813172500a4c587e785642942/main.dart.js
/Users/benversoza/Documents/Fresh_Start/FireBaseGettingStarted/lib/.dart_tool/flutter_build/c517bab813172500a4c587e785642942/app.dill
#0 RunResult.throwException (package:flutter_tools/src/base/process.dart:127:5)
#1 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:326:19)

#2 Dart2JSTarget.build (package:flutter_tools/src/build_system/targets/web.dart:195:5)

#3 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:875:9)

#4 Future.wait. (dart:async/future.dart:524:21)

#5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)

#6 Future.wait. (dart:async/future.dart:524:21)

#7 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)

#8 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:642:16)

#9 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:91:34)

#10 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:237:5)

#11 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1394:27)

#12 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)

#13 CommandRunner.runCommand (package:args/command_runner.dart:212:13)

#14 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:360:9)

#15 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)

#16 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:300:5)

#17 run.. (package:flutter_tools/runner.dart:119:9)

#18 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)

#19 main (package:flutter_tools/executable.dart:94:3)

Compiling lib/main.dart for the Web... 26.0s
Error: Failed to compile application for the Web.

@sigmundch
Copy link
Member

Thanks @bvversoz, unfortunately I think something else in the tooling is hiding the original error.

Is the input you are using by chance something you can reduce to a repro you could share with us so we can try it locally?

@christopherfujino - I'm wondering if flutter tool may be invoking dart2js after a failure on a previous step when generating the app.dill, and that previous error is being shadowed accidentally, is that possible? Are there by chance other issues reported on the flutter issue tracker related to this?

@github-actions github-actions bot removed the needs-info We need additional information from the issue author (auto-closed after 14 days if no response) label Mar 6, 2024
@Chris248539
Copy link

I am having the exact same issue, is this something that was resolved?

Target dart2js failed: ProcessException: Process exited abnormally with exit code 253:
.dart_tool/flutter_build/8b9f3dac2e5f4951a43c9cb22d496247/app.dill:
Internal Error: The compiler crashed when compiling this element.
The compiler is broken.

@kaumudpa
Copy link

Same issue here - This is Breaking all our builds with GitHub Actions which uses ubuntu based runners but on our local mac machines we are able to build without issues.

@christopherfujino christopherfujino self-assigned this Apr 23, 2024
@christopherfujino
Copy link
Member

I'm wondering if flutter tool may be invoking dart2js after a failure on a previous step when generating the app.dill, and that previous error is being shadowed accidentally, is that possible? Are there by chance other issues reported on the flutter issue tracker related to this?

Assigning to myself to investigate this

@lz5577
Copy link

lz5577 commented Jun 28, 2024

Limiting the version of cached_network_image_web in the pubspec.yaml file can avoid this problem

dependency_overrides:
cached_network_image_web: 1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. web-dart2js
Projects
None yet
Development

No branches or pull requests

7 participants