Hi, I am using @elastic/apm-rum in react to trace errors.
I have uploaded the source map to elastic rum and the sourcemaps are accessible at /api/apm/sourcempas
But when an error occured, the error trace on kibana is shown in compile javascript form
I have tried searching the internet and tried all the options discussed in sourcemap to error stack doesn't work · Issue #1289 · elastic/apm-agent-rum-js · GitHub
I also tried giving both relative and absolute path for bundle_path but still it doesn't work
I have also matched the service name and service version both are correct
Here is my script i am using to upload my sourcemaps to kibana:
for file in "$BUILD_DIR"/*.map; do
# Extract the JS bundle file path by removing the .map extension
bundle_filepath="${file%.map}"
# Remove 'public' from the start of the file path
relative_filepath="${bundle_filepath#./public/}"
echo "Uploading sourcemap for bundle: $bundle_filepath.map"
# Send the curl request to upload the sourcemap
curl -X POST $API_URL \
-H "Content-Type: multipart/form-data" \
-H "kbn-xsrf: true" \
-H "Authorization: ApiKey $AUTH_KEY" \
-F "service_name=$SERVICE_NAME" \
-F "service_version=$SERVICE_VERSION" \
-F "bundle_filepath=$relative_filepath" \
-F "sourcemap=@$bundle_filepath.map" \
--max-time 6000
echo "Uploaded $file"
done
Here is the command after putting example paths
curl -X POST https://<kibanadomain.com>:5601/api/apm/sourcemaps
-H Content-Type: multipart/form-data
-H kbn-xsrf: true
-H Authorization: ApiKey $API_KEY
-F service_name=<service_name>
-F service_version=<service_version>
-F bundle_filepath=zen/javascripts/react/build/taskForm.screen-7BSIKK63.js
-F sourcemap=@./public/zen/javascripts/react/build/taskForm.screen-7BSIKK63.js.map
--max-time 6000
============Version Info============
Kibana: 8.11.3
Elasticsearch: 8.11.3
APM: 8.11.3
APM agent: apm-rum javascript agent 5.16.0
Install method: using deb
Fresh install
Nothing custom being done