datadog-ci icon indicating copy to clipboard operation
datadog-ci copied to clipboard

react-native support for uploading source map to datadog

Open nisevi opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe: No, this is not a problem at the moment, is just a nice to have I would like to know is possible.

Describe the solution you'd like: Hi there, was mentioned here we can upload dist for having the sourcemap, but how do we achieve the same with react-native?

Additional context: We have a react-native app we would like to setup to have a stack trace of the errors we may face 🤖 .

nisevi avatar Apr 19 '22 17:04 nisevi

Hello, unfortunately we don’t provide support for unminification with react-native at the moment. However, this is on our roadmap for the coming months. We can provide an update on this issue when support is released.

rpelliard avatar Apr 20 '22 15:04 rpelliard

what would an example for the --minified-path-prefix?

andrew-hm avatar May 10 '22 00:05 andrew-hm

I tried to run the datadog-ci react-native upload command according to here,

datadog-ci react-native upload --platform ios --service xxx --bundle ./temp/main.jsbundle --sourcemap ./temp/main.jsbundle.map --release-version 0.0.0-1 --build-version 1 

but it returns the request timeout error. Screen Shot 2022-10-31 at 12 10 10 PM

hankwz avatar Oct 31 '22 19:10 hankwz

I am able to upload the source maps without any issue. But DataDog does not show the unminified code. Is this document valid https://github.com/DataDog/datadog-ci/tree/master/src/commands/react-native#upload

I get the error like this in DataDog. I see unminification failed and it's not mapped to the source. image

vkundapur avatar Apr 20 '23 13:04 vkundapur

Hi @vkundapur, could you share a screenshot of the result of the upload command?

If you've setup your project to automatically send sourcemaps on builds, that will be in the Android build output, under the following section:

> Task :app:uploadReleaseSourcemaps

Alternatively, you can also reach out to our support team which will be able to assist you by looking at your particular case.

louiszawadzki avatar Apr 20 '23 14:04 louiszawadzki

Hi @vkundapur, could you share a screenshot of the result of the upload command?

If you've setup your project to automatically send sourcemaps on builds, that will be in the Android build output, under the following section:

> Task :app:uploadReleaseSourcemaps

Alternatively, you can also reach out to our support team which will be able to assist you by looking at your particular case.

Thanks for the response. The upload is completing successfully.

image

vkundapur avatar Apr 20 '23 14:04 vkundapur

Hi @vkundapur,

Thanks for providing this screenshot. From the output I believe you're using a version from @datadog/datadog-ci somewhere between 2.6.0 and 2.8.0. There's a bug in these versions that would cause the sourcemaps not to be indexed on our end on some conditions.

Could you update to version 2.8.1, which includes a fix for this issue, and try to submit the sourcemap once again?

Let me know if you still have the issue.

louiszawadzki avatar Apr 20 '23 15:04 louiszawadzki

Hi @vkundapur,

Thanks for providing this screenshot. From the output I believe you're using a version from @datadog/datadog-ci somewhere between 2.6.0 and 2.8.0. There's a bug in these versions that would cause the sourcemaps not to be indexed on our end on some conditions.

Could you update to version 2.8.1, which includes a fix for this issue, and try to submit the sourcemap once again?

Let me know if you still have the issue.

Thanks @louiszawadzki. That seems to fix the issue

vkundapur avatar Apr 21 '23 07:04 vkundapur

Awesome! I'm closing this issue since the original one (react-native being supported) is fixed :) Feel free to open a new issue if you encounter any issue with React Native sourcemaps upload!

louiszawadzki avatar Apr 21 '23 07:04 louiszawadzki