You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/website/docs/guides/troubleshooting.md
+37-26Lines changed: 37 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,7 @@
1
+
import Tabs from "@theme/Tabs";
2
+
import TabItem from "@theme/TabItem";
3
+
import CodeBlock from "@theme/CodeBlock";
4
+
1
5
#Troubleshooting
2
6
3
7
:::tip
@@ -9,36 +13,13 @@ While troubleshooting, always start your application without the cache!
9
13
10
14
:::
11
15
12
-
Before troubleshooting NativeWind, it's crucial to ensure that Tailwind CSS itself is functioning correctly. NativeWind uses the Tailwind CLI to compile your styles, so any issues with Tailwind CLI should be resolved first. You can inspect the Tailwind CSS output at the following location:`node_modules/.cache/nativewind/<input-css-filename>.<platform>.css`, or by simply running`npx tailwindcss --input <input.css>`.
13
-
14
-
For instance, if you've observed that a custom class`text-brand` isn't behaving as expected. You can proceed as follows:
15
-
16
-
1. First, ensure that your`tailwind.config.js` has the necessary configurations for the color.
17
-
2. Navigate to`node_modules/.cache/nativewind/<input-css-filename>.<platform>.css` and search for the CSS class`.text-brand {}`
18
-
19
-
If you cannot locate the`.text-brand` CSS rule, it hints at an issue with your`tailwind.config.js`. To further validate this, run the command
20
-
21
-
```bash
22
-
npx tailwindcss --input<input.css>
23
-
```
24
-
25
-
If this output also lacks`.text-brand`, it confirms the misconfiguration.
26
-
27
-
To troubleshoot Tailwind CSS, refer to their[Troubleshooting Guide](https://tailwindcss.com/docs/content-configuration#troubleshooting).
28
-
29
-
**Only once you see the expected CSS being generated should you start this troubleshooting guide.**
16
+
Before troubleshooting NativeWind, it's crucial to ensure that Tailwind CSS itself is functioning correctly. NativeWind uses the Tailwind CLI to compile your styles, so any issues with Tailwind CLI should be resolved first. Using the command`npx tailwindcss --input <input.css> --output output.css`, Tailwind CLI will generate an`output.css` file. If you are troubleshooting a class that is not working, ensure that the css rule is present in the`output.css` file.
30
17
31
18
##Verifying NativeWind Installation
32
19
33
-
NativeWind provides a utility function,`verifyInstallation()`, designed to help confirm that the package has been correctly installed.
34
-
35
-
Import the`verifyInstallation` function from the NativeWind package and run within the scope of a React component.**It's crucial to ensure that you do not invoke this function on the global scope.**
36
-
37
-
:::tip
20
+
NativeWind provides a utility function`verifyInstallation()` designed to help confirm that the package has been correctly installed.
38
21
39
-
`verifyInstallation()` will`warn` on success and`error` on failure. If you do not see any output check the function is being executed correctly.
40
-
41
-
:::
22
+
Import the`verifyInstallation` function from the NativeWind package and run within the scope of a React component.**Do not invoke this function on the global scope**, it should be run within a component.
42
23
43
24
```tsx
44
25
importReactfrom'react';
@@ -56,6 +37,36 @@ function App() {
56
37
exportdefaultApp;
57
38
```
58
39
40
+
##Enabling debug mode
41
+
42
+
NativeWind supports the`DEBUG` environment variable and will output various debug information while your server is running.
@react-native-community/cli may create multiple terminal sessions. You will need to ensure all sessions have`DEBUG=nativewind` set.
56
+
57
+
:::
58
+
59
+
By itself, this information may or may not be useful to you, but it is extremely useful when reporting to the developers on GitHub. You can record the terminal output by redirecting the output to a file.
Copy file name to clipboardExpand all lines: apps/website/src/pages/v4/troubleshooting.mdx
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
importTabsfrom"@theme/Tabs";
2
2
importTabItemfrom"@theme/TabItem";
3
+
importCodeBlockfrom"@theme/CodeBlock";
3
4
4
5
#Troubleshooting
5
6
@@ -17,7 +18,7 @@ module.exports = function (api) {
17
18
};
18
19
```
19
20
20
-
If you are stillrecieving this error after including the preset, you most likely have another preset or plugin overriding the`jsxImportSource`. If so, explictly set the options of`@babel/plugin-transform-react-jsx` within your`plugins` array.
21
+
If you are stillreceiving this error after including the preset, you most likely have another preset or plugin overriding the`jsxImportSource`. If so, explictly set the options of`@babel/plugin-transform-react-jsx` within your`plugins` array.
Copy file name to clipboardExpand all lines: packages/react-native-css-interop/src/doctor.native.tsx
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,14 @@ export function verifyJSX() {
6
6
}
7
7
8
8
exportfunctionverifyData(){
9
+
if(process.env.NODE_ENV!=="test"){
10
+
if(require("./interop-poison.pill")===false){
11
+
thrownewError(
12
+
`Your 'metro.config.js' has overridden the 'config.resolver.resolveRequest' config setting in a non-composable manner. Your styles will not work until this issue is resolved. Note that 'require('metro-config').mergeConfig' is a shallow merge and does not compose existing resolveRequest functions together.`,