前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ThreeJS导入失败 - plus studio

ThreeJS导入失败 - plus studio

作者头像
plus sign
发布2024-02-28 21:27:46
1310
发布2024-02-28 21:27:46
举报
文章被收录于专栏:个人博客个人博客

问题描述

代码语言:text
复制
-index.html 
-src.js
-node_modules
 -three
  -...

src.js 中用如下方式导入ThreeJS

代码语言:text
复制
import * as THREE from 'three';

index.html body如下

代码语言:text
复制
<body>
    <script type="module" src="/src/day01_a.js"></script>
</body>

出现报错

代码语言:text
复制
Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".

## 解决方案 stackoverflow给出了解决方案https://stackoverflow.com/questions/65697410/not-using-node-js-uncaught-typeerror-failed-to-resolve-module-specifier-thre

删除src.js的导入,将index.html body改为

代码语言:text
复制
Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2023-1-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 问题描述
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档