adrianhajdin / project_threejs_ai

https://jsmastery.pro
922 stars 277 forks source link

SOLUTION TO CORS POLICY OF DIGITAL OCEAN #17

Open SergDeved opened 1 year ago

SergDeved commented 1 year ago

I was testing the deployment of the application and doing the deployment in LAN at home to access from my phone, to my surprise when exposing the application in the LAN network it does not load the app and in the console it shows the digital ocean cors policy error , after a while the solution is this. You have to access the index.jsx file in the canvas directory and modify the Environment line.

        <Environment path="/hdri/" files="potsdamer_platz_1k.hdr" />

And you have to create a directory in the client folder called hdri, inside this you have to store the file potsdamer_platz_1k.hdr

GitHub does not support uploading this file but you can download it directly from the browser console by clicking on the link in the CORS policy error.

Captura

I hope it helps you

SheaDevop commented 1 year ago

the error comes from a down service that the package react-three/drei points to get a resource, upgrading to version after 9.70.4 looks like fixing problem. This issue has been discussed in https://github.com/pmndrs/drei/issues/1492 .

SergDeved commented 1 year ago

Oh great!

Shree-MAVERICK commented 1 year ago

I am facing this error while using this line <Environment preset="city" />

1

51fe commented 1 year ago

If you can't access https://market-assets.fra1.cdn.digitaloceanspaces.com/market-assets/hdris/potsdamer-platz/potsdamer_platz_1k.hdr, you'll get the issue. I have fixed it by the commit : https://github.com/adrianhajdin/project_threejs_ai/pull/21/commits/a65fa00a7b7c6dcb9423f2e2cbf518039f85c158

pradeepthsjain commented 1 year ago

As soon as i click on ai full or ai logo button my screen goes white and i can see errors on the server terminal and even in inspect console. Screenshot (8) ![Screenshot (9)](https://github.com/adrianhajdin/project_threejs_ai/assets/115602871/712d6f9b-014d-4565-a1fd Screenshot (10) -8d91beeafb68) Screenshot (11) Can someone please help me out with this....?