@@ -4,6 +4,52 @@ title: Troubleshooting
4
4
sidebar_label : Troubleshooting
5
5
---
6
6
7
+ ## Async await doesn't resolve
8
+
9
+ If you're having issues with ` getItem() ` and friends not resolving, check if
10
+ ` inlineRequires ` is enabled in ` metro.config.js ` :
11
+
12
+ ``` js
13
+ module .exports = {
14
+ transformer: {
15
+ getTransformOptions: async () => ({
16
+ transform: {
17
+ experimentalImportSupport: false ,
18
+ inlineRequires: true ,
19
+ },
20
+ }),
21
+ },
22
+ };
23
+ ```
24
+
25
+ If disabling it resolves the issue, it's likely that you hit a circular import
26
+ chain. You can try excluding ` @react-native-async-storage/async-storage ` from
27
+ being inlined:
28
+
29
+ ``` diff
30
+ module.exports = {
31
+ transformer: {
32
+ getTransformOptions: async () => ({
33
+ transform: {
34
+ experimentalImportSupport: false,
35
+ inlineRequires: true,
36
+ + nonInlinedRequires: [
37
+ + "@react-native-async-storage/async-storage",
38
+ + 'React',
39
+ + 'react',
40
+ + 'react-native',
41
+ + ],
42
+ },
43
+ }),
44
+ },
45
+ };
46
+ ```
47
+
48
+ If this doesn't resolve the issue, you need to figure out what is causing the
49
+ cyclic chain. There are tools, such as
50
+ [ @rnx-kit/metro-plugin-cyclic-dependencies -detector] ( https://github.com/microsoft/rnx-kit/tree/main/packages/metro-plugin-cyclic-dependencies-detector#rnx-kitmetro-plugin-cyclic-dependencies-detector ) ,
51
+ that can help you debug this.
52
+
7
53
## [ iOS] CocoaPods issues
8
54
9
55
1 . Delete the ` node_modules ` folder(s) from your project
@@ -54,7 +100,7 @@ info 1 error generated.
54
100
55
101
## [ @RNC/AsyncStorage ] : NativeModule: AsyncStorage is null
56
102
57
- #### iOS
103
+ ### iOS
58
104
59
105
This error means that AsyncStorage was unable to find its native module. This
60
106
occurs because AsyncStorage was not linked into the final app bundle.
0 commit comments