Skip to content

[0.32,0.33] Browser field in package.json not working #9854

@Bhullnatik

Description

@Bhullnatik

Issue Description

When using a module which implement browser: {} in their package.json, the corresponding module(s) specified in the package.json will return null (Ref 1 and Ref 2) instead of an empty object as per the spec. This then throws an Unknown module error because the packager assumes that it didn't find a module when getting null (Ref).

I tracked the issue down to the new version of node-haste being used in React Native since the 0.32 version (cc @davidaurelio), but I'm not sure of how to fix it myself.

Steps to Reproduce / Code Snippets

Import a package using the browser field in package.json to ignore modules. https://github.com/yahoo/intl-messageformat for example (Ref package.json and incriminating line)

Expected Results

it should import an empty object instead of throwing an error.

Additional Information

  • React Native version: [0.32, 0.33]
  • Platform(s) (iOS, Android, or both?): packager
  • Operating System (macOS, Linux, or Windows?): *

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