0

I keep getting this error when I start my metro bundler JSON value 'N' of type NSString cannot be converted to NSNumber after upgrade to the new RN 0.71.x how can I get this npx react-native-asset run automatically

Tirzah
  • 1
  • Just change your data type from NSString to NSNumber – tornadoradon Apr 21 '23 at 03:36
  • Does this answer your question? [React Native - NSNumber cannot be converted to NSString](https://stackoverflow.com/questions/35640369/react-native-nsnumber-cannot-be-converted-to-nsstring) – tornadoradon Apr 21 '23 at 03:37
  • Please provide enough code so others can better understand or reproduce the problem. – Community Apr 21 '23 at 10:26
  • No. I scan the code, the only code snippet I can find with NSNumber is. ```- (void)testRendersWelcomeScreen { UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; BOOL foundElement = NO; __block NSString *redboxError = nil; #ifdef DEBUG RCTSetLogFunction( ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { if (level >= RCTLogLevelError) { redboxError = message; } }); #endif``` – Tirzah Apr 22 '23 at 07:28
  • I replace NSNumber with NSString. it does not help at all – Tirzah Apr 22 '23 at 07:30
  • here is a code snippet that I am not sure if this is pointing there ```const styles = StyleSheet.create({ label: { color: 'black', marginVertical: 5, // height: 10, }, input: { borderRadius: 5, borderColor: 'black', borderWidth: 1, height: 50, }, inputContainer: { width: '100%', height: 80, }, }); ``` – Tirzah Apr 22 '23 at 07:33
  • I noticed in the jest unit test xx.test.js.snap there is this code ``` – Tirzah Apr 22 '23 at 07:37
  • why is the borderRadius become a string "N"? – Tirzah Apr 22 '23 at 07:37
  • Package.json: "jest": "^29.2.1", "@types/jest": "^29.2.1", "ts-jest": "^29.0.5", – Tirzah Apr 22 '23 at 07:38

0 Answers0