Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Dynamics serving Web File as unexpected file type

Posted on by 5

I have a portal app that uses web files to serve an Angular 13 app.

When I build the app locally to test it I can see it serves the build files as Content-Type=application/javascript; charset=UTF-8 and the app renders the correct values to the page. (2nd screenshot)

However, when I upload the same build files as Web Files in Dynamics CRM I can see that they are being served as Content-Type=text/javascript and the Javascript is not evaluated. (1st screenshot)

1) Could someone kindly tell me what could be stopping Dynamics CRM from interpreting the Web Files as Content-Type=application/JavaScript; charset=UTF-8?

2) Is there a site setting in Dynamics that could be blocking this particular Content-Type?


I can overcome this by using the recommended ahead-of-time compilation setting in the Angular build steps, but this issue has seemingly come out of nowhere and it would be cool to know if this is a configuration option in Dynamics. 

Below is when the app is running in the Dynamics portal. Served as Content-Type=text/javascript and not interpolating template values.
  

pastedimage1668406266581v3.png

Below is the same identical file running in my local environment. Being served as Content-Type=application/javascript; charset=UTF-8 and working as expected.

pastedimage1668406017534v2.png

Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans