Skip to content

[web] flutter run -d chrome --debug does not boot with specific Record code #129482

Description

@S-YOU

Is there an existing issue for this?

Steps to reproduce

Specific code that cause stuck (no window appear) flutter run in debug mode (release mode run fine)

-v mode show, program stopped at this line

[ +4 ms] <- compile org-dartlang-app:/web_entrypoint.dart

code that cause this eror.

// ...
author: json['author'] != null ? ((json) => (name: json['name']))(json['author']) as BlogPageBlogEntriesAuthorRecord : null,
// ...

I don't know which part is wrong, ternary or closure or Record code or type or variable name.

Here is full function, it parse json into Record.

BlogPageRecord parseBlogPage(Map<String, dynamic> json) {
  return (
    blog: ((json) => (
          blogId: json['blogId'],
          title: json['title'],
          entries: json['entries']
              .map<BlogPageBlogEntriesRecord>((json) => (
                    authorId: json['authorId'],
                    body: json['body'],
                    entryId: json['entryId'],
                    title: json['title'],
                    author: json['author'] != null ? ((json) => (name: json['name']))(json['author']) as BlogPageBlogEntriesAuthorRecord : null,
                    // author: null,
                  ) as BlogPageBlogEntriesRecord)
              .toList(),
        ))(json['blog']) as BlogPageBlogRecord,
  );
}

If I change to author: null, it boots, so problem must be there.

typedefs are here for reference

typedef BlogPageRecord = ({
  BlogPageBlogRecord blog,
});
typedef BlogPageBlogRecord = ({
  String blogId,
  String title,
  List<BlogPageBlogEntriesRecord> entries,
});
typedef BlogPageBlogEntriesRecord = ({
  String authorId,
  String body,
  String entryId,
  String title,
  BlogPageBlogEntriesAuthorRecord? author,
});
typedef BlogPageBlogEntriesAuthorRecord = ({
  String name,
});

Expected results

Browser window open and application is shown.

Actual results

flutter run stuck and application does not start (no browser window open)

Code sample

Screenshots or Video

Logs

Flutter Doctor output

Doctor output (I am not using iOS or android for now, only web(chrome) on Linux)

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.5, on Ubuntu 22.04.2 LTS 5.19.0-45-generic, locale C.UTF-8)
[✗] Android toolchain - develop for Android devices
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
[✓] Chrome - develop for the web
[✗] Linux toolchain - develop for Linux desktop
    ✗ GTK 3.0 development libraries are required for Linux development.
      They are likely available from your distribution (e.g.: apt install libgtk-3-dev)
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
[✓] VS Code (version 1.79.2)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 3 categories.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listdependency: dartDart team may need to help usfound in release: 3.10Found to occur in 3.10found in release: 3.12Found to occur in 3.12has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-webOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.

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