-
Notifications
You must be signed in to change notification settings - Fork 465
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
● Test suite failed to run [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. #1045
Comments
Have you seen jest integration docs? |
Any Update on this issue? |
How to fix this issue ? |
Any Progress. Still facing this issue @krizzu |
I'm also facing this issue. And have tried all the listed steps (and I can't easily downgrade to an expo sdk < 50) Log: To fix this issue try these steps: • Uninstall, rebuild and restart the app. • Run the packager with • If you are using CocoaPods on iOS, run • Make sure your project's • If this happens while testing with Jest, check out how to integrate AsyncStorage here: https://react-native-async-storage.github.io/async-storage/docs/advanced/jest If none of these fix the issue, please open an issue on the GitHub repository: https:/react-native-async-storage/async-storage/issues
|
This issue has been marked as stale due to inactivity. Please respond or otherwise resolve the issue within 7 days or it will be closed. |
I just recently hit this issue. I did not work around it because it looks like it may have been an issue with different versions of async-storage being required by different packages. The number of dependencies I would have had to change was more than I wanted so I ended up downgrading the version of async-storage to one that matches with the versions declared by other packages. Maybe this helps to identify the issue in your own projects. |
I use mocks directory from Jest integration instruction, but got error export * from '@react-native-async-storage/async-storage/jest/async-storage-mock';
// added the line below
export { default } from '@react-native-async-storage/async-storage/jest/async-storage-mock'; |
I am still facing this issue. Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. in ios run. I have tried everything but not solved my issue. |
IssueWhen running tests for the component, you may encounter the following error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.SolutionTo resolve this issue, follow the steps below:
}
Summary
Save this content to a file named |
This issue has been marked as stale due to inactivity. Please respond or otherwise resolve the issue within 7 days or it will be closed. |
What happened?
I am trying to run unit test in my react native file and I am getting this error. I tried a lot of things available on the internet still nothing worked for me. I have been Stuck on this for more than 2 weeks now. Any Help would be highly appreciated.
This is my jest.config.js file
module.exports = { preset: 'react-native', transform: { '^.+\\.jsx$': 'babel-jest', }, transformIgnorePatterns: [ 'node_modules/(?!(jest-)?@?react-native|@react-native-community|@react-navigation|@react-native-community/async-storage|@react-native-async-storage)', ], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], testEnvironment: 'node', };
This is my package.json
devDependencies: { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/eslint-config": "^0.72.2", "@react-native/metro-config": "^0.72.11", "@testing-library/react-native": "^12.3.2", "@tsconfig/react-native": "^3.0.0", "@types/jest": "^29.5.8", "@types/react": "^18.2.33", "@types/react-native": "^0.72.6", "@types/react-test-renderer": "^18.0.5", "babel-jest": "^29.2.1", "eslint": "^8.51.0", "jest": "^29.7.0", "metro-react-native-babel-preset": "0.76.8", "prettier": "^2.4.1", "react-test-renderer": "18.2.0", "sonarqube-scanner": "^3.1.0", "ts-jest": "^29.1.1", "typescript": "4.8.4" }
This is the error that I am getting
Version
^1.21.0
What platforms are you seeing this issue on?
System Information
Steps to Reproduce
Run this command "npm test" and you get the issue
The text was updated successfully, but these errors were encountered: