Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac Catalyst builds are broken for x86_64 arch #50388

Open
birdofpreyru opened this issue Mar 30, 2025 · 13 comments
Open

Mac Catalyst builds are broken for x86_64 arch #50388

birdofpreyru opened this issue Mar 30, 2025 · 13 comments
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.

Comments

@birdofpreyru
Copy link
Contributor

Description

Image

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

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Mar 30, 2025
@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@cipolleschi
Copy link
Contributor

@birdofpreyru thanks for the issue, but I can't reproduce it, as you can see below.

Image

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?

@birdofpreyru
Copy link
Contributor Author

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.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Apr 1, 2025
@birdofpreyru
Copy link
Contributor Author

birdofpreyru commented Apr 1, 2025

@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.

@birdofpreyru birdofpreyru reopened this Apr 1, 2025
@birdofpreyru birdofpreyru changed the title mac catalyst builds are broken Mac Catalyst builds are broken for x86_64 arch Apr 1, 2025
@duralabs
Copy link

duralabs commented Apr 3, 2025

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 ","

@cipolleschi
Copy link
Contributor

@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.

@birdofpreyru
Copy link
Contributor Author

@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.

@birdofpreyru
Copy link
Contributor Author

birdofpreyru commented Apr 3, 2025

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.

Screen.Recording.2025-04-03.at.21.30.10.mov

@duralabs

This comment has been minimized.

@cipolleschi
Copy link
Contributor

@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.

@birdofpreyru
Copy link
Contributor Author

@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"]]) {

@birdofpreyru
Copy link
Contributor Author

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"]]) {

cipolleschi added a commit to cipolleschi/react-native that referenced this issue Apr 7, 2025
Summary:
When building React Native for mac catalyst on intel architecture, we are observing a build failure in RCTInstance.
See issue: facebook#50388

Apparently, the compiler don't understand that `errorData[@"isFatal"]` is a BOOL, so we are helping it by extracting the `boolValue`.

## Changelog:
[iOS][Fixed] -  Avoid build failure on Catalyst (x86_64)

Differential Revision: D72558024
@cipolleschi
Copy link
Contributor

Cool, we can go with the latest! #50514

facebook-github-bot pushed a commit that referenced this issue Apr 7, 2025
Summary:
Pull Request resolved: #50514

When building React Native for mac catalyst on intel architecture, we are observing a build failure in RCTInstance.
See issue: #50388

Apparently, the compiler don't understand that `errorData[@"isFatal"]` is a BOOL, so we are helping it by extracting the `boolValue`.

## Changelog:
[iOS][Fixed] -  Avoid build failure on Catalyst (x86_64)

Reviewed By: cortinico

Differential Revision: D72558024

fbshipit-source-id: 152d89b02ae250a8ae54fe2df658c018d5f63f45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.
Projects
None yet
Development

No branches or pull requests

4 participants