javascript - app.js:3524 Uncaught ReferenceError: THREE not defined at Object../node_modules/three-bmfont-text/index.js
问题描述
我正在尝试使用 Three.js 和 three-bmfont-text 来创建 3D 文本并使用着色器给它一个漂亮的外观。
我通过npm安装三三bmfont-text并导入到js文件中:
import * as THREE from 'three';
const loadFont = require('load-bmfont');
const createGeometry = require('three-bmfont-text');
我运行 npm run dev 和 npm run watch ,一切似乎都运行良好,但在 chrome developer 中,它记录了以下错误:
app.js:3524 Uncaught ReferenceError: THREE not defined at Object../node_modules/three-bmfont-text/index.js
我尝试安装和卸载三个和三个 bmfont-text 但没有任何变化,我错过了什么?
解决方案
推荐阅读
- android - Android Gradle Plugin: Property 'applicationId' is not annotated with an input or output annotation
- docker - Dockerfile:在另一个 ENV 中引用先前定义的 ENV
- rust - Why is an empty tuple returned instead of a mutable string slice with a lifetime annotation when using `insert_str`?
- api - Chrome API - detect tab with user input
- angular - how to handle view child static error in angular 8
- android - 受限 API 没有响应
- octave - Octave 'wavread' 未定义
- android - ML Kit Firebase 翻译文本 null Kotlin Android
- python - Python:ValueError:无法将字符串转换为浮点数:读取输入文件以应用随机森林时“隔离”
- php - 从 xmlparser 访问 xml 属性