# Stack trace not appearing in a front-end application

**URL:** <https://community.dynatrace.com/t/stack-trace-not-appearing-in-a-front-end-application/38464>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic, application-monitoring\
**Created:** [February 15, 2023, 10:04pm UTC](https://community.dynatrace.com/t/stack-trace-not-appearing-in-a-front-end-application/38464 "2023-02-15T22:04:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tasjordao](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@tasjordao](https://community.dynatrace.com/u/tasjordao)\
**Post date:** [February 15, 2023, 10:04pm UTC](https://community.dynatrace.com/t/stack-trace-not-appearing-in-a-front-end-application/38464/1 "2023-02-15T22:04:55Z")

</div>

Hi Guys,

We are missing a stack trace at Dynatrace from our front-end application. We can’t see it on the error details (see the image).

Our current structure looks like this:

- App Service (not right, but it is our current service style)  
- SPA (Vue) besides other index.HTML files from Static Server Generation (SSG)  
- O index.html consumes js files from a CDN (which has another subdomain. So, index.html in [domain.com](http://domain.com) gets JS files from [cdn.domain.com](http://cdn.domain.com))

- OneAgent injection

- Our frontend has the source map configuration

Any ideas on how to solve it?

 ![Screen Shot 2023-02-15 at 18.53.58.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/f/6f9c3be105cba5c17bda062e5b10dc81b54b73b9.png)

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [April 13, 2023, 12:53pm UTC](https://community.dynatrace.com/t/stack-trace-not-appearing-in-a-front-end-application/38464/2 "2023-04-13T12:53:23Z")

</div>

[@tasjordao](https://community.dynatrace.com/user/59702)&nbsp;are you still having this issue? If you resolved it would you mind sharing with us your findings and resolution?

---

<div class="post-metadata">

**Author:** ![asp-vm](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@asp-vm](https://community.dynatrace.com/u/asp-vm)\
**Post date:** [April 19, 2024, 12:29pm UTC](https://community.dynatrace.com/t/stack-trace-not-appearing-in-a-front-end-application/38464/3 "2024-04-19T12:29:43Z")

</div>

I would be interested as well on what the solution was if one was found

---

<div class="post-metadata">

**Author:** ![gbaudart](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@gbaudart](https://community.dynatrace.com/u/gbaudart)\
**Post date:** [April 19, 2024, 1:46pm UTC](https://community.dynatrace.com/t/stack-trace-not-appearing-in-a-front-end-application/38464/4 "2024-04-19T13:46:49Z")

</div>

Hi&nbsp;[@ChadTurner](https://community.dynatrace.com/user/14877)&nbsp;,&nbsp;[@asp-vm](https://community.dynatrace.com/user/72736)&nbsp;,  
While waiting for an answer from the author, I know that in my case I had to add the x-dtc header so that the user actions correlated well with my traces.

In certain cases, if you use agentless and if you activate cross-origin, it may be necessary to pass the x-dtc header into CORS in order to be able to link user actions (or errors) to backend traces.

documentation link :&nbsp;[https://docs.dynatrace.com/docs/platform-modules/digital-experience/web-applications/initial-setup/l…](https://docs.dynatrace.com/docs/platform-modules/digital-experience/web-applications/initial-setup/link-cross-origin-xhrs)

---

<div class="post-metadata">

**Author:** ![simon\_schatka](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@simon\_schatka](https://community.dynatrace.com/u/simon_schatka)\
**Post date:** [April 23, 2024, 10:12am UTC](https://community.dynatrace.com/t/stack-trace-not-appearing-in-a-front-end-application/38464/5 "2024-04-23T10:12:46Z")

</div>

I don’t see how the x-dtc header would affect the stacktrace of an error, as they have nothing to do with each other.

In general, my best guess is, that this is not really a javascript error and therefore there is no stacktrace.

An example for this, which we regularly see, is something along the line of “unexpected token \<”. This happens when you include a file in the page using \<script\> tags, but the file is not really a javascript file (or what also regularly happens, the file does not exist and returns a 404 html page or some similar error page with html instead of javascript code)  
You’d have to provide more information on the error to get more help.

---

<div class="post-metadata">

**Author:** ![simon\_schatka](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@simon\_schatka](https://community.dynatrace.com/u/simon_schatka)\
**Post date:** [April 24, 2024, 2:57pm UTC](https://community.dynatrace.com/t/stack-trace-not-appearing-in-a-front-end-application/38464/6 "2024-04-24T14:57:34Z")

</div>

Since you now contacted us via Chat as well, I have more information and can reveal the full solution to this issue.

The javascript error is showing up as “Script error”.

This means that the browser is restricting the information, because the script file in question needs to have&nbsp; **crossorigin=“anonymous”** &nbsp;on the script tag, so the browser will expose more information.

**Important:** If this attribute is set, the script file MUST have the “Access-Control-Allow-Origin:” header set to allow the source domain (by default it is “\*”), otherwise the script file is not executed at all!

---

<div class="post-metadata">

**Author:** ![asp-vm](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@asp-vm](https://community.dynatrace.com/u/asp-vm)\
**Post date:** [April 25, 2024, 8:02am UTC](https://community.dynatrace.com/t/stack-trace-not-appearing-in-a-front-end-application/38464/7 "2024-04-25T08:02:55Z")

</div>

Thank you. I will feedback all the recommendations on this thread to the developers.
