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

Flutter web only shows white screen #152522

Closed
kuyaC opened this issue Jul 29, 2024 · 2 comments
Closed

Flutter web only shows white screen #152522

kuyaC opened this issue Jul 29, 2024 · 2 comments
Labels
r: invalid Issue is closed as not valid

Comments

@kuyaC
Copy link

kuyaC commented Jul 29, 2024

Steps to reproduce

Unfortunately I can't share the proprietary code, but I will try to share as much information as possible about the issue I encountered.

So as the title says, when I try to run my flutter web app from android studio on chrome, I only see a white screen. It's been over half a year since I last worked on this project, I have already updated everything (flutter, dart, dependencies...).

Expected results

The web app should display normally.

Actual results

I get a white screen and even print, debugPrint, and log statements at the very top of my main()-method don't output anything in the console.

Code sample

Code sample

main.dart:

void main() async {
  // None of these even get printed in the output (see logs below)
  debugPrint('debugPrint');
  log('log');
  // print('print'); // "Don't invoke 'print' in production code."
  
  //...

  runApp(MyApp());
}

pubspec.yaml:

name: my_app_name
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: '>=2.12.0 <3.0.0'

dependencies:
  flutter:
    sdk: flutter

  flutter_localizations:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2

  #by flutter/google
  firebase_core: ^3.2.0
  firebase_auth: ^5.1.2
  cloud_firestore: ^5.1.0
  cloud_functions: ^5.0.3
  firebase_app_check: ^0.3.0+3
  shared_preferences: ^2.2.0

  provider: ^6.0.5

  #other
  flutter_spinkit: ^5.1.0
  flutter_tts: ^4.0.2
  html_editor_enhanced: ^2.6.0

  #...

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^4.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    #- assets/country_flags/
    - assets/learning_guide.png
    - assets/admin_learning_guide.png
    - lang/

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

Screenshots or Video

Chrome DevTools screenshot

Logs

Logs
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
This app is linked to the debug service: ws://127.0.0.1:57531/eaZ7RkjmvoI=/ws
Debug service listening on ws://127.0.0.1:57531/eaZ7RkjmvoI=/ws
Debug service listening on ws://127.0.0.1:57531/eaZ7RkjmvoI=/ws
Rejecting promise with error: TypeError: Cannot set properties of undefined (setting 'nativeCommunication')

A message on the flutter/lifecycle channel was discarded before it could be handled.
This happens when a plugin sends messages to the framework side before the framework has had an opportunity to register a listener. See the ChannelBuffers API documentation for details on how to configure the channel to expect more messages, or to expect messages to get discarded:
  https://api.flutter.dev/flutter/dart-ui/ChannelBuffers-class.html
A message on the flutter/lifecycle channel was discarded before it could be handled.
This happens when a plugin sends messages to the framework side before the framework has had an opportunity to register a listener. See the ChannelBuffers API documentation for details on how to configure the channel to expect more messages, or to expect messages to get discarded:
  https://api.flutter.dev/flutter/dart-ui/ChannelBuffers-class.html
A message on the flutter/lifecycle channel was discarded before it could be handled.
This happens when a plugin sends messages to the framework side before the framework has had an opportunity to register a listener. See the ChannelBuffers API documentation for details on how to configure the channel to expect more messages, or to expect messages to get discarded:
  https://api.flutter.dev/flutter/dart-ui/ChannelBuffers-class.html
Application finished.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-x64, locale en-GB)
    • Flutter version 3.22.3 on channel stable at /Users/cedricdiederich/flutter
    • Upstream repository https:/flutter/flutter.git
    • Framework revision b0850beeb2 (13 days ago), 2024-07-16 21:43:41 -0700
    • Engine revision 235db911ba
    • Dart version 3.4.4
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/cedricdiederich/Library/Android/sdk
    • Platform android-34, build-tools 30.0.3
    • ANDROID_HOME = /Users/cedricdiederich/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] Android Studio (version 2021.3)
    • Android Studio at /Users/cedricdiederich/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.91.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.92.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos                     • darwin-x64     • macOS 14.5 23F79 darwin-x64
    • Chrome (web)    • chrome                    • web-javascript • Google Chrome 127.0.6533.73

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Jul 30, 2024
@danagbemava-nc
Copy link
Member

This is caused by html_editor_enhanced. See tneotia/html-editor-enhanced#523 for a similar issue on their repository.

Closing from here as this is an issue caused by a third party plugin.

Thank you

@danagbemava-nc danagbemava-nc closed this as not planned Won't fix, can't repro, duplicate, stale Jul 30, 2024
@danagbemava-nc danagbemava-nc added r: invalid Issue is closed as not valid and removed in triage Presently being triaged by the triage team labels Jul 30, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: invalid Issue is closed as not valid
Projects
None yet
Development

No branches or pull requests

2 participants