Closed amhinson closed 1 year ago
Same error occurs when I follow the manually on each build (with Hermes) instructions as well.
Hi @amhinson, thanks for reaching out!
I am able to reproduce the issue. I am investigating and will let you know about what we can do about it.
I can tell you that it looks like there is nothing wrong with your setup, I believe the most likely cause is that some recent changes in the react native xcode script broke the way we get the source map when Hermes is enabled.
I believe a proper fix would require a new release of datadog-ci
.
In the meantime, I will also try to find a workaround, as I believe the Manual upload steps are also likely to be broken.
Hi @amhinson!
I have great news!
To make the upload work you should only need to add a export USE_HERMES=true
line in the datadog-sourcemaps.sh
file (right after the set -e
line for instance).
Tell me if it works for you and I'll update the documentation soon to reflect this.
The issue is that now that Hermes is enabled by default, some checks in the react native xcode script are not working as intended and the source map does not get generated.
It's been fixed on the main RN branch by several PRs, but it has not been released yet.
Setting the USE_HERMES
env variable to true
explicitly tells the script that Hermes is used.
Thanks a lot for taking the time to provide an easy reproduction!
@louiszawadzki Still seeing the same no such file or directory
error unfortunately.
@amhinson, I forgot that there's one more thing I had to change in your sample project to enable the app to build: remove the await
keyword in the App.js
before DdSdkReactNative.initialize(config);
.
As you are not making this call inside a function, await
cannot be called here. As you're calling the initialization early in your app, you don't need to await it.
If that still does not work, can you run the project from XCode (opening it by running xed ios
from your project root) and share the output from the build?
Thanks
Still seeing the same thing in Xcode, even after removing await
:
That log is from running a debug build, which I think you've addressed in https://github.com/DataDog/datadog-ci/pull/691.
When I ran a Release build, it was successful! 🎉 Thanks for the quick help!
Great!
I'll update our documentation and datadog-ci
as well so that in the future you won't have to specify USE_HERMES=true
in your shell script.
If that's ok with you I'll also close the issue, feel free to reopen it if there is something we missed :)
Hitting the same issue. Build failure trying to upgrade to Expo 46 and building with EAS / custom dev client.
Tried passing flag USE_HERMES: "1"
in the eas.json env vars as a workaround. No luck.
I tried installing this package from master instead of npm to see if the fix works, but I get datadog-ci not found
so I'm guessing some binary is missing when sourced from git? Unsure on that, might just need to wait for the official release.
export USE_HERMES=true
seemed to worked for my fresh sample app that I provided, but I am actually still getting the same error in my actual project, which is much larger and has a handful of customizations to the Xcode project. Right now I'm assuming it is just some configuration issue on my end and not an issue with the library, but I plan on digging in a bit more in the next week or so.
If I can track down any more info, I'll post it here.
I was able to verify that the source map is not generated for configurations other than explicitly Release
. I added a new scheme and configuration to my testing app (new-config
branch) that duplicated Release
to Staging Release
, and I'm seeing the same original error.
@louiszawadzki Any suggestions on how to generate source maps for other configurations?
Hi!
@jacobhummel you should be able to update datadog-ci
to version 2.0.0
which includes a fix for this :)
I believe there is no other way to do it with EAS, maybe you could try editing your project in XCode if you are using the expo-dev-client or managed workflow, but that might get overwritten in EAS.
Tell me if that works for you! If not, feel free to reopen this issue :)
@amhinson we have an option for this, which is the --force
argument on the react-native xcode
command.
It is documented here if you want to know more about it.
It might not be convenient for you to upload your sourcemaps only for Staging Release
and not Debug
for instance.
You can either edit your build phase in xcode when you build for that Staging Release
scheme, or add the argument conditionally (for examples you can look this post in Stack Overflow).
The build scheme in the CONFIGURATION
environment variable.
If that does not work, feel free to open another issue dedicated to this matter so we avoid crossing topics on this one :)
I tried 2.0.0 yesterday and it worked! Thank you so much.
Describe what happened When following the React Native setup instructions to automatically upload iOS source maps, I'm running into the following error after running
DATADOG_API_KEY=<API_KEY> yarn ios
:I'm fairly confident that I've done all of the steps in the documentation, but I'm not sure why I am receiving this error. It seems like
datadog-ci xcode
is looking in the wrong location for the sourcemap file.Steps to reproduce the issue:
I originally saw this in my larger project, but I was able to reproduce it with a fresh React Native app (repo). You will just need to do the following after pulling down the repo:
yarn && npx pod-install
config.js
file in the root directory with the following variables:DATADOG_API_KEY=<API_KEY> yarn ios
Expected behaviour: Produce sourcemap and upload.
Actual behaviour: Error (See above)
Additional context