Closed john-redd closed 1 year ago
should be fixed in pr https://github.com/nrwl/nx/pull/17382 should be in the next release 16.4.0
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
As of version 16.0.0+beta5 of the @nx/react-native plugin, any executor or generator that makes use of the
runPodInstall
utility will fail. This utility can be found in file. This is the commit in the version 16.0.0+beta5 release that introduced this new behavior.The reason for this behavior is that the deprecation warnings for changes to ruby
ERB.new()
are routed to stderr when invoking thepod install
command in a child process. I am unfortunately not very familiar with Ruby and I am not exactly sure what Ruby version starts to report these deprecation warnings. I currently get this behavior with the system default installation (ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22]
) of ruby on my M2 Mac.The easiest way to reproduce this issue is with the nx command for generating a new nx workspace with the react-native template.
This command produces the following output.
I will include the mentioned log file in the failure logs section of the report.
The last two lines of the output contained in the failure logs are the deprecation warnings that are causing the command to fail.
Here is the source file. If you look at line 51, you will see a valid syntax that won't cause the error, but what is shipped in react native releases can be found here. The deprecated syntax is what is shipped. I am not 100% positive at what point in the deployment cycle of react-native this occurs, but I am assuming it is done for some level of backwards compatibility for versions 2.6 & 2.7 of ruby.
Expected Behavior
This command should properly generate a react native workspace.
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
Operating System
Additional Information
Until this is fixed, you can use one of the following workaround.
Option One
To suppress the deprecation warnings produced by the child process that invokes
pod install
you can the following line to your shell profile (eg:.zshrc
,.bashrc
, etc)Once again I am not very familiar with the ruby ecosystem, but I believe that this will suppress all warnings, not just deprecation warnings, so for those that do ruby development, this is probably not the greatest behavior.
Option Two
You can use the same environment variable, just at the command/process level like so.
RUBYOPT=-W0 nx run-ios mobile
or
RUBYOPT=-W0 npx create-nx-workspace happynrwl \ --preset=react-native \ --appName=mobile \ --nxCloud=false \ --verbose
This probably the preferred workaround for those who do ruby development and don't want to globally suppress their warnings.
Proposed Solutions
I am happy to help out with a long term fix, but would like to know the preferred direction of the Nx team. I am currently seeing three options as of right now.
pod install
to stdout instead of stderr.runPodInstall
utility (app generator, run-ios, and possibly others. I haven't checked this in depth yet) that allows for suppressing of ruby warnings via theRUBYOPT=-W0
environment variable being set in the child process.I believe that one of these three is the best solution for because this issue has the mentioned instance that comes directly from the react-native source, and getting a fix upstream in that source could probably take a while, especially if the use of the deprecated syntax is in fact a backwards compatibility effort.