Mac Catalyst builds are broken for x86_64 arch
Description
Steps to reproduce
Just try to build a project for mac Catalyst.
React Native Version
0.78.1
Affected Platforms
Build - MacOS
Output of npx @react-native-community/cli info
N/A
Stacktrace or Logs
N/A
Reproducer
N/A
Screenshots and Videos
No response
[!WARNING] Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:
- If your bug is UI related: a Snack
- If your bug is build/upgrade related: a project using our Reproducer Template
- Otherwise send us a Pull Request with the RNTesterPlayground.js edited to reproduce your bug.
@birdofpreyru thanks for the issue, but I can't reproduce it, as you can see below.
Can you try by creating a new app with:
npx @react-native-community/cli init NewApp --version latest
and report back? Have you tried cleaning the pods and node_modules?
Sorry @cipolleschi , my bad, indeed it works with a clean project. Does not work in my project even after cleaning all artifacts from previous builds... but, I guess, it is on me then, to figure out what has got screwed in my case.
@cipolleschi actually, it happens in the clean project as well, when building for x86_64 architecture (i.e. created a new app, set Mac Catalyst as the destination, selected Any Mac (Mac Catalyst, arm64, x86_64) build, and built the project). The arm64 part of the build works just fine.
We have the same issue as @birdofpreyru. New project init using @react-native-community/cli fails to build for Mac. We get the following error message. TransformError [SyntaxError]: <redacted>/node_modules/react-native/Libraries/Components/Pressable/Pressable.js: Unexpected token, expected ","
@birdofpreyru is it because you are on an intel machine? I don't have that option on my machine. I don't know how to debug it. I'll have to ask you to provide more info on where the compiler fails. We are probably missing a @() wrapping around some variable. It should fail to build also on arm64, tbh.
@duralabs your is a different problem You r app built natively but then it fails when you try to load the bundle. Please clean node modules and reinstall the js dependencies and try again. Also, please search in the issue tracker as we already discussed and solved the problem in other issues.
@cipolleschi no, that's on M3 Pro MacBook, with the latest macOS 15.4 and Xcode 16.3. Though, I believe I started to experience this problem a month or two ago, with a previous version of RN, OS, Xcode, just did not reported it immediately.
Here is a little screen recording, to also show you that it does something weird — when I click the build error, it is first highlighted as the error in the code, but shortly after the highlight disappears, as if Xcode changes opinion and thinks the code is just fine.
https://github.com/user-attachments/assets/eac6bbff-267f-426e-bc77-60c8fa920371
@birdofpreyru is it because you are on an intel machine? I don't have that option on my machine. I don't know how to debug it. I'll have to ask you to provide more info on where the compiler fails. We are probably missing a
@()wrapping around some variable. It should fail to build also on arm64, tbh.@duralabs your is a different problem You r app built natively but then it fails when you try to load the bundle. Please clean node modules and reinstall the js dependencies and try again. Also, please search in the issue tracker as we already discussed and solved the problem in other issues.
We've removed and rebuilt js dependencies a number of times and the issues persist. We searched the issues list for Mac Catalyst build errors and nothing we found matches our issue. Can you link one of the previously opened issues that you are referring to?
@duralabs please open another issue. the problem is different. Your build is not failing on mac catalyst.
@birdofpreyru can you try to replace line 527 like this:
originalMessage:errorData[@"originalMessage"]
name:errorData[@"name"]
componentStack:errorData[@"componentStack"]
exceptionId:error.id
- isFatal:errorData[@"isFatal"]
+ isFatal: @(error.isFatal);
extraData:errorData[@"extraData"]]) {
and try again?
we set the errorData[@"isFatal"] property some lines above. It could be that the compiler for other archs struggles from outo-boxing the id to BOOL.
@cipolleschi nope, but this replacement turns out to work for me:
originalMessage:errorData[@"originalMessage"]
name:errorData[@"name"]
componentStack:errorData[@"componentStack"]
exceptionId:error.id
- isFatal:errorData[@"isFatal"]
+ isFatal:error.isFatal
extraData:errorData[@"extraData"]]) {
this one as well works:
originalMessage:errorData[@"originalMessage"]
name:errorData[@"name"]
componentStack:errorData[@"componentStack"]
exceptionId:error.id
- isFatal:errorData[@"isFatal"]
+ isFatal:[errorData[@"isFatal"] boolValue]
extraData:errorData[@"extraData"]]) {
Cool, we can go with the latest! https://github.com/facebook/react-native/pull/50514
Works for me too, thanks
this one as well works:
originalMessage:errorData[@"originalMessage"] name:errorData[@"name"] componentStack:errorData[@"componentStack"] exceptionId:error.id
isFatal:errorData[@"isFatal"]
isFatal:[errorData[@"isFatal"] boolValue] extraData:errorData[@"extraData"]]) {
I think we can close this as the crash is fixed