nativewind icon indicating copy to clipboard operation
nativewind copied to clipboard

Non-std c++ exception

Open tonnyhc opened this issue 2 years ago • 6 comments

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 400509796_898418984692987_5286089385705706336_n

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.

tonnyhc avatar Dec 10 '23 17:12 tonnyhc

Same here

takuyahirata23 avatar Dec 11 '23 13:12 takuyahirata23

Ảnh màn hình 2023-12-12 lúc 02 00 41 I found that this is causes by this plugins. I tried to comment this line and it work, but my tailwind code not working anymore, needed to be suppport now:(

ngoc2003 avatar Dec 11 '23 19:12 ngoc2003

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
}

siquick avatar Dec 12 '23 10:12 siquick

Having this issue too, has anyone found a fix?

Logan9312 avatar Jan 06 '24 19:01 Logan9312

same issue

stefanobrambilla avatar Jan 17 '24 15:01 stefanobrambilla

same

marionlouis1 avatar Jan 20 '24 17:01 marionlouis1

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: [],
};

oscar-v0 avatar Feb 01 '24 18:02 oscar-v0

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.

marklawlor avatar Feb 14 '24 03:02 marklawlor

I just had this. Completely out of the blue and only resolvable with @oscar-v0's solution

finallyblueskies avatar Feb 19 '24 15:02 finallyblueskies

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 avatar Mar 01 '24 01:03 conradkoh

@conradkoh That warning is in the Tailwind installation docs. NativeWind v4 has code to attempt to detect this and warn the user.

marklawlor avatar Mar 01 '24 01:03 marklawlor

make sure your content isn't also including your node_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: [],
}

devantic avatar Apr 24 '24 09:04 devantic

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'

surajahmed avatar May 13 '24 07:05 surajahmed

In my case, it was due to babel presets in babel.config.js

CyxouD avatar Aug 08 '24 14:08 CyxouD