Skip to content

packager confused with RxJS which requires Node's EventEmitter #447

@staltz

Description

@staltz

I'm experimenting with using Cycle with React Native. Cycle depends on RxJS's npm package, which in turn requires Node's 'events' package, which I suppose does not exist in whatever environment React Native is running in.

The consequence is a runtime error Requiring unknown module "events". Cycle uses browserify, and the resulting bundle does not contain the RxJS code which requires 'events', that's why this runtime error does not happen with Cycle running in browsers.

I see some possible actions to solve this:

  • Make packager work more like browserify, using the same solutions.
  • packager warning, instead of runtime error, for unknown modules required.
  • RxJS's npm package should not have Node-specific functions, but instead put those in a special purpose rx.node.js helper library. cc @mattpodwysocki

I believe this issue affects not only Cycle, but any time anyone attempts to use RxJS together with React Native.

Metadata

Metadata

Assignees

No one assigned

    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