Non-std c++ exception
Describe the bug
Using react native expo with typescript, tailwindcss and nativewind. When the nativewind/babel plugin is added inside babel.config.js
To Reproduce Steps to reproduce the behavior: Open babel.config.js, and paste the "plugins: ["nativewind/babel"]," stop the server run the server again using npx expo start --clear (to clear the cache) and this error occurs "non-std C++ exception"
Screenshots
Additional context This dont happen everytime, it happens from time to time, and the only solution is to create a completely new app, paste all the code inside and after some time clearing the cache it will happen.
Same here
Just started getting this too. Complete clean Expo project
{
"name": "myapp",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"ts:check": "tsc"
},
"dependencies": {
"expo": "~49.0.15",
"expo-status-bar": "~1.6.0",
"nativewind": "^2.0.11",
"react": "18.2.0",
"react-native": "0.72.6",
"typescript": "^5.1.3",
"@types/react": "~18.2.14"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"tailwindcss": "3.3.2"
},
"private": true
}
Having this issue too, has anyone found a fix?
same issue
same
Had the same issue and managed to resolve this by moving all my js/ts files into a src directory and changing tailwind.config.js to only target files in my src dir:
module.exports = {
- content: ['./**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
theme: {
extend: {},
},
plugins: [],
};
I cannot troubleshoot an issue with reproduction repo. I'm going to close this issue as not enough information has been provided.
If your experiencing this issue, make sure your content isn't also including your node_modules. If your still having the issue, please create a new issue with a full reproduction.
I just had this. Completely out of the blue and only resolvable with @oscar-v0's solution
Had the same problem. Frustrating because it was working fine the day before. It was also strange because it should have broke many commits ago but decided to fail all of a sudden.
@marklawlor wdyt if we just added a line to the docs to warn people not to put in something that may accidentally include node_modules?
Debugging this was really hard too, as there is no indication in the error that nativewind was causing the issue, even from the macos console. I had to deconstruct the entire app down to a simple App.js and add the dependencies one by one to ultimately find that this caused the issue.
@conradkoh That warning is in the Tailwind installation docs. NativeWind v4 has code to attempt to detect this and warn the user.
make sure your
contentisn't also including yournode_modules.
There's high chance this is what is happening. If you name the top level files explicitly like in the nativewind docs it shouldn't happen.
module.exports = {
content: ["./App.{js,jsx,ts,tsx}", "./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
}
In my situation, the presence of spaces in the displayName of a component led to this issue. This problem was resolved by removing the space from the displayName. The adjustment was made from:
CustomSelectComponent.displayName = 'Custom Select Component'
to
CustomSelectComponent.displayName = 'CustomSelectComponent'
In my case, it was due to babel presets in babel.config.js