Rxdart: Flutter for web support

Created on 14 Oct 2019  路  8Comments  路  Source: ReactiveX/rxdart

Hey there. Upon my attempt to try rxdart for web development, I've created a sample project:
flutter create myapp
added rxdart dependency:
rxdart: 0.22.3
And then imported it as:
import 'package:rxdart/rxdart.dart';

No errors or warning whatsoever, however If you try to run project via flutter run -d chrome error appears:

Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).

Please check the following imports:

`import 'package:rxdart/rxdart.dart';` from myapp|lib/main.dart at 5:1

Close the ticket if this question has already been asked, but all other dependencies work just fine.

Most helpful comment

Honestly no clue, haven't been able to try out the web compile yet though (will soon to test this issue).

Afaik web compilation for Flutter is still experimental, so it might just be something to fix on their end.

All 8 comments

Could you share your pubspec file?

@frankpepermans I have same issue.

pubspec.yaml

name: myproject
description: A new Flutter project.

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  http: ^0.12.0+2
  rxdart: ^0.22.4

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

dev_dependencies:
  flutter_test:
    sdk: flutter


# 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/
  #  - images/a_dot_ham.jpeg

  # 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

This issue is reproduced only for flutter run -d chrome.

flutter build web works, and then App works on the web.

Honestly no clue, haven't been able to try out the web compile yet though (will soon to test this issue).

Afaik web compilation for Flutter is still experimental, so it might just be something to fix on their end.

The issue is resolved, thanks!

Have the same issue with rxdart 0.23.1

Same here with rxdart 0.23.1, user the same issue of web

Hey all -- I'm really not sure what to make of this one :/ Overall, it seems to work well in some projects and break in others.

I might be wrong, but if RxDart works fine in a regular build of Flutter, but does not work in Flutter Web, I'd imagine it has to do with the Flutter Web toolchain in some capacity, which is still in beta. It might be more fruitful to post this issue on the flutter github than here, since it's unclear why an import would fail to work only with Flutter web, while working fine with Dart, Flutter and AngularDart for years.

Was this page helpful?
0 / 5 - 0 ratings