Skip to content

dart2js: "Maximum call stack size exceeded" when getter & setter for private fields in mixins #44636

Description

@noliran

Hi folks,

Background:
Working on getting an iOS and Android Flutter project that uses MobX to work with Flutter Web.

When I building the project with flutter build web and serving it, everything's fine.
However, when I try to run it with flutter run -d chrome I get a "Maximum call stack size exceeded" error:

The following JSRangeError was thrown building MyApp(dirty):
Invalid argument: Maximum call stack size exceeded

The relevant error-causing widget was: 
  MyApp file:///Users/_/git/js_bug_repro/lib/main.dart:34:10
When the exception was thrown, this was the stack: 
packages/js_bug_repro/main.dart 14:5                                     get [_test]
packages/js_bug_repro/main.dart 14:18                                    get [_test]
packages/js_bug_repro/main.dart 14:18                                    get [_test]
packages/js_bug_repro/main.dart 14:18                                    get [_test]
packages/js_bug_repro/main.dart 14:18                                    get [_test]
...
====================================================================================================

Steps to reproduce:
I've been able to peel away all the wizardry around MobX and reproduce the bug consistently in this gist: https://gist.github.com/noliran/27d10d009f847f55c232df0bc8353763

  • flutter run -d chrome

Potential workarounds:
--> Making the field public (_test -> test) solves the problem
--> Removing the Store mixin solves the problem
--> Running the output of flutter build web directly

Notes:

Environment:

  • Dart SDK version: 2.12.0-141.0.dev (dev) (Thu Dec 10 06:04:48 2020 -0800) on "macos_x64"
  • Flutter (Channel dev, 1.26.0-1.0.pre, on Mac OS X 10.15.6 19G2021 darwin-x64, locale en)
  • Mac OS X, Chrome

Metadata

Metadata

Assignees

Labels

area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compiler

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions