Skip to content

Invariant can't be imported in TypeScript under jest vs metro-bundler/packager (in react-native)  #32

@fbartho

Description

@fbartho

Using invariant imported with the following two patterns fails opposite depending on how we run the build (either as unit-tests under jest, or as a react-native view on android).

import * as invariant from "invariant";
import invariant from "invariant";

Swapping the import from one to the other enables/disables using invariant in the opposite target.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions