This works fine locally. I can see that the network request is going to localhost/assets/Shooter/Export_players_03.gltf
and the response is the gltf file as expected.
I’ve deployed the app to AWS Amplify. The app builds and deploys successfully, but doesn’t load the gltf file. I get an error…
Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse
The network call seems to be going to the right place…
newAmplifyDomain/assets/Shooter/Export_players_03.gltf
But it’s returning html in the response!
Can anyone give me any insight as to why this is happening?!
cloudflare pages is free and has unlimited data. https://pages.cloudflare.com/ . I say again, unlimited edge cdn bandwidth for free. Ignore all the marketing shit about collaborative builds and previews, pointless. Anyway, it will also fix your url problem.
Cheers guys - was down to Amplify, have sorted it.
For anyone else - in the rewrites and redirects section of Amplify - you have to tell it to redirect all requests for X file type to index.html as the app is supposed to load all assets itself.
Should look something like this…