Skip to content

Support for react-native #29

Open
@Darkhorse-Fraternity

Description

@Darkhorse-Fraternity

Support for react-native please

Activity

dai-shi

dai-shi commented on Oct 21, 2019

@dai-shi
Owner

I wasn't aware that. What is your problem?

Oh no, it doesn't work in Expo Snack.
https://snack.expo.io/H1bnzhqtr

If I download the snack, it seems to work in this case.

alvinthen

alvinthen commented on Apr 15, 2020

@alvinthen

I've been using this package on react, this is the first time I run it on react-native, here's the error I got

error: bundling failed: Error: Unable to resolve module `core-js/modules/es.symbol` from `node_modules/react-hooks-async/dist/use-async-run.js`: core-js/modules/es.symbol could not be found within the project.

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules: rm -rf node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*

yarn why core-js output

=> Found "core-js@2.6.11"
info Has been hoisted to "core-js"
info Reasons this module exists
   - Hoisted from "fbjs#core-js"
   - Hoisted from "react-native#metro-babel-register#core-js"
   - Hoisted from "react-native#fbjs-scripts#core-js"
info Disk size without dependencies: "7.68MB"
info Disk size with unique dependencies: "7.68MB"
info Disk size with transitive dependencies: "7.68MB"
info Number of shared dependencies: 0
=> Found "create-react-class#core-js@1.2.7"
info Reasons this module exists
   - "react-native#create-react-class#fbjs" depends on it
   - Hoisted from "react-native#create-react-class#fbjs#core-js"
info Disk size without dependencies: "4.37MB"
info Disk size with unique dependencies: "4.37MB"
info Disk size with transitive dependencies: "4.37MB"
info Number of shared dependencies: 0

Edit: Explicitly installing core-js@3 fixed it.

dai-shi

dai-shi commented on Apr 15, 2020

@dai-shi
Owner

Thanks for trying it out.
Yeah, the compiled code depends on core-js@3. We had a similar discussion in another issue, but I'm not really sure what's a good config for that. 😕

It's really glad to hear that it's working with explicit installing.
I could close this issue technically, but let's keep it open and look for a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @dai-shi@alvinthen@Darkhorse-Fraternity

        Issue actions

          Support for react-native · Issue #29 · dai-shi/react-hooks-async