# Deploying a 3D website using three.js getting mime type and csp error react framework

**URL:** <https://forum.dfinity.org/t/deploying-a-3d-website-using-three-js-getting-mime-type-and-csp-error-react-framework/20313>\
**Category:** JavaScript\
**Created:** [May 29, 2023, 3:51pm UTC](https://forum.dfinity.org/t/deploying-a-3d-website-using-three-js-getting-mime-type-and-csp-error-react-framework/20313 "2023-05-29T15:51:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Myartbar](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Myartbar](https://forum.dfinity.org/u/Myartbar)\
**Post date:** [May 29, 2023, 3:51pm UTC](https://forum.dfinity.org/t/deploying-a-3d-website-using-three-js-getting-mime-type-and-csp-error-react-framework/20313/1 "2023-05-29T15:51:55Z")

</div>

Deploying a 3D website using three.js getting mime type and csp error react framework  
[https://62paw-dqaaa-aaaak-aeveq-cai.icp0.io](https://62paw-dqaaa-aaaak-aeveq-cai.icp0.io)

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [May 29, 2023, 4:03pm UTC](https://forum.dfinity.org/t/deploying-a-3d-website-using-three-js-getting-mime-type-and-csp-error-react-framework/20313/2 "2023-05-29T16:03:43Z")

</div>

Is it a new project with a recent dfx version? If yes, probably the same issue / solution as [React frontend: Setting content-security-policy in the index.html doesn't seem to do anything? - #2 by peterparker](https://forum.dfinity.org/t/react-frontend-setting-content-security-policy-in-the-index-html-doesnt-seem-to-do-anything/19257/2)

---

<div class="post-metadata">

**Author:** ![Myartbar](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Myartbar](https://forum.dfinity.org/u/Myartbar)\
**Post date:** [May 30, 2023, 2:52pm UTC](https://forum.dfinity.org/t/deploying-a-3d-website-using-three-js-getting-mime-type-and-csp-error-react-framework/20313/3 "2023-05-30T14:52:06Z")

</div>

Thank you but I couldn’t understand what to do there

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [May 30, 2023, 3:43pm UTC](https://forum.dfinity.org/t/deploying-a-3d-website-using-three-js-getting-mime-type-and-csp-error-react-framework/20313/4 "2023-05-30T15:43:40Z")

</div>

If you look into your `.ic-assets.json5` file(s) you should see the content-security policy for your project. You can update it there, redeploy, and then it should work

---

<div class="post-metadata">

**Author:** ![Myartbar](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Myartbar](https://forum.dfinity.org/u/Myartbar)\
**Post date:** [May 30, 2023, 6:56pm UTC](https://forum.dfinity.org/t/deploying-a-3d-website-using-three-js-getting-mime-type-and-csp-error-react-framework/20313/5 "2023-05-30T18:56:01Z")

</div>

hello thank you for your response, I am new to coding didn’t understand what to change I am trying to deploy a website I created.

---

<div class="post-metadata">

**Author:** ![Myartbar](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Myartbar](https://forum.dfinity.org/u/Myartbar)\
**Post date:** [May 30, 2023, 7:00pm UTC](https://forum.dfinity.org/t/deploying-a-3d-website-using-three-js-getting-mime-type-and-csp-error-react-framework/20313/6 "2023-05-30T19:00:33Z")

</div>

Can you help me with this as well I have created a website and have it deployed on icp using [GitHub - MioQuispe/create-ic-app: Use your favourite frontend framework with the Internet Computer](https://github.com/MioQuispe/create-ic-app) starter template.  
[https://6gl2h-uqaaa-aaaak-aevgq-cai.icp0.io/](https://6gl2h-uqaaa-aaaak-aevgq-cai.icp0.io/)  
Canister link  
[GitHub - neel-icp/ic-vite-project](https://github.com/neel-icp/ic-vite-project.git) repo link  
I am getting these errors  
index.567ec01f.js:6496 SyntaxError: Unexpected token ‘\<’, "\<!DOCTYPE "... is not valid JSON at JSON.parse ()  
at jT.parse (index.567ec01f.js:6496:165748)  
at Object.onLoad (index.567ec01f.js:6496:164892)  
at index.567ec01f.js:6496:130861  
Would greatly appreciate your help as I have been trying to get it to work for a long time

---

<div class="post-metadata">

**Author:** ![Myartbar](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Myartbar](https://forum.dfinity.org/u/Myartbar)\
**Post date:** [May 30, 2023, 7:02pm UTC](https://forum.dfinity.org/t/deploying-a-3d-website-using-three-js-getting-mime-type-and-csp-error-react-framework/20313/7 "2023-05-30T19:02:01Z")

</div>

and this was the repo where I was getting mime type error [GitHub - neel-icp/ic](https://github.com/neel-icp/ic.git)

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [May 31, 2023, 7:15am UTC](https://forum.dfinity.org/t/deploying-a-3d-website-using-three-js-getting-mime-type-and-csp-error-react-framework/20313/8 "2023-05-31T07:15:33Z")

</div>

I don’t have the time to debug your project for you, but I can give you some pointers

> [@Myartbar](#):
>
> index.567ec01f.js:6496 SyntaxError: Unexpected token ‘\<’, "\<!DOCTYPE "… is not valid JSON at JSON.parse ()

This sounds like you’re trying to parse an HTML file with a JSON parser or you’re using it in a place where JSON is expected

For the CSP error, while I don’t recommend it for production code, you can go to `frontend/assets/.ic-assets.json5` and delete the line that starts with `"Content-Security-Policy"`. If the website then works, you can start adding it back in part by part and read up on the options if you’d like to. Also please make sure that you’re using the latest version of dfx (use `dfx upgrade` if you’re unsure)
