正如標題所述,每當我部署我的應用程式時,整個 Three.js 專案都會完美部署,但我的 .glb 檔案收到 404 資源未找到錯誤。我不確定是什么問題。我嘗試更改檔案路徑但沒有成功。我正在使用 Vite.js 進行本地運行
Github 存盤庫 - https://github.com/ElijahSchrock/Neo-Runner
Heroku 部署 - https://neo-runner.herokuapp.com/
這是我的 package.json
這是我的創建角色功能
這是 Don McCurdy 在 Threejs 論壇https://discourse.threejs.org/t/when-i-deploy-to-heroku-my-deployment-is-successful-but-my-glb-file-receives上的看法 -404-錯誤/32750/2
而且我還使用靜態構建包以及 nodejs 構建包。請幫忙 !!謝謝!:)
uj5u.com熱心網友回復:
您的 glTF 資產路徑存在一個小問題。代替:
loader.load('./Neo.glb', (gltf) => {
你想使用:
loader.load('./model/Neo.glb', (gltf) => {
uj5u.com熱心網友回復:
通過將我的檔案托管在 aws s3 上并在我的 gltf 加載器中使用該物件 url 已解決了這個錯誤。確保正確設定您的 CORS
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/393364.html
標籤:javascript 英雄联盟 三.js 维特
