gpt4 book ai didi

javascript - three.module.js 的 404 错误(找不到文件)

转载 作者:行者123 更新时间:2023-12-05 06:21:28 25 4
gpt4 key购买 nike

这可能是一个 skool boi 错误,但我收到一个 404 错误提示:

http://localhost:8000/Desktop/Skeletor/js/build/three.module.js net::ERR_ABORTED 404 (File not found)

应该说

http://localhost:8000/Desktop/Skeletor/MYPROJECT/js/build/three.module.js

所以我正在运行一个短目录,我看不出为什么或哪里出错了。是的,我从

../build/three.module.js

./build/three.module.js

故意的。

这是从 the three.js webgl loader example 复制的 index.html 中的 js

<script type="module">

import * as THREE from './build/three.module.js';

import { OrbitControls } from './jsm/controls/OrbitControls.js';
import { GLTFLoader } from './jsm/loaders/GLTFLoader.js';

目录结构是这样的:

MyProject/
index.html
.DS_Store
styles.css
obj/
dime_low.glb
textures/
00.jpg
build/
three.module.js
.DS_Store
jsm/
.DS_Store
controls/
.DS_Store
OrbitControls.js
loaders/
.DS_Store
RGBELoader.js
GLTFLoader.js

一切都通过 Python 使用简单的 HTTP 服务器在本地运行

放轻松,我今天是来填色的,不是学习 three.js :)

最佳答案

build文件夹必须在外面一个文件夹,jsm和build不能在同一个目录,试试这个 enter image description here

关于javascript - three.module.js 的 404 错误(找不到文件),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59842878/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com