Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve "react-async-hook" #515

Open
shessafridi opened this issue Sep 27, 2023 · 5 comments
Open

Unable to resolve "react-async-hook" #515

shessafridi opened this issue Sep 27, 2023 · 5 comments

Comments

@shessafridi
Copy link

Issue Description

Project doesn't build after installing

Web Bundling failed 19319ms
Unable to resolve "react-async-hook" from "node_modules\react-native-country-picker-modal\lib\Flag.js"

Steps to Reproduce / Code Snippets

npm i react-native-country-picker-modal world-countries

Expected Results

It should work

Additional Information

  • Nodejs version: v18.17.1
  • React version: 18.2.0
  • React Native version: 0.72.4
  • react-native-country-picker-modal version: ^2.0.0
  • Platform(s) (iOS, Android, web, or all?): web
  • TypeScript version: 5.2.2
@shessafridi
Copy link
Author

shessafridi commented Sep 27, 2023

metro.config.js

const { getDefaultConfig } = require('expo/metro-config');

module.exports = (() => {
  const config = getDefaultConfig(__dirname);

  const { transformer, resolver } = config;

  config.transformer = {
    ...transformer,
    babelTransformerPath: require.resolve('react-native-svg-transformer'),
  };
  config.resolver = {
    ...resolver,
    assetExts: resolver.assetExts.filter(ext => ext !== 'svg'),
    sourceExts: [...resolver.sourceExts, 'svg'],
  };
  config.resolver.sourceExts = [...config.resolver.sourceExts, 'mjs', 'cjs'];

  return config;
})();

@prasannjeet
Copy link

any resolution to this issue yet? can we downgrade to a version to fix it?

@GibbyBox
Copy link

GibbyBox commented Oct 17, 2023

I currently just patch the modules package json to denote where to find the package and it works fine. This was fixed in later versions of react-async-hook

Run the following and follow the on screen instructions.

yarn patch react-async-hook

If you're using npm, use patch-package

Edit package.json with the following change

-  "module": "react-async-hook.esm.js",
+  "module": "dist/react-async-hook.esm.js",

npm / yarn install once complete to apply the changes to your node_modules.

@chidexebere
Copy link

yarn patch react-async-hook did not run in my case....saying Command "patch" not found.

@Ibeenoch
Copy link

Ibeenoch commented Jul 20, 2024

any solution to this yet? i have tried all the above on react-native expo, still having the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants