You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using react three fiber with Next.js. But when trying to import three-mesh-ui I get the following error. I am not sure what I am doing wrong. Any ideas?
Server Error
ReferenceError: THREE is not defined
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown>
file:///Users/noahk/Documents/netzbros/WebXR-feature-xr-painter/node_modules/three-mesh-ui/build/three-mesh-ui.min.js (1:1267)
Object.<anonymous>
file:///Users/noahk/Documents/netzbros/WebXR-feature-xr-painter/node_modules/three-mesh-ui/build/three-mesh-ui.min.js (1:67023)
Module._compile
node:internal/modules/cjs/loader (1105:14)
Object.Module._extensions..js
node:internal/modules/cjs/loader (1159:10)
Module.load
node:internal/modules/cjs/loader (981:32)
Function.Module._load
node:internal/modules/cjs/loader (822:12)
Module.require
node:internal/modules/cjs/loader (1005:19)
require
node:internal/modules/cjs/helpers (102:18)
Object.three-mesh-ui
file:///Users/noahk/Documents/netzbros/WebXR-feature-xr-painter/.next/server/pages/test.js (72:18)
__webpack_require__
file:///Users/noahk/Documents/netzbros/WebXR-feature-xr-painter/.next/server/webpack-runtime.js (33:42)
The text was updated successfully, but these errors were encountered:
Whereas I wasn't being able to solve the issue, I still manage to get some clues.
The issue seems to come from when the project tries to import the "js" version (global lib) of three-mesh-ui.
This version requires js version of three to be globally loaded first. https://github.com/felixmariotto/three-mesh-ui#js
When I've tried to force importing the module version of tree-mesh-ui I had errors about disallowing imports outside of modules. You can check this issue to know how I tried it #213
I am using react three fiber with Next.js. But when trying to import three-mesh-ui I get the following error. I am not sure what I am doing wrong. Any ideas?
I've installed
my dependencies
The text was updated successfully, but these errors were encountered: