-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot import { OrbitControls } from three/examples/jsm #4
Comments
🚁 Workaround1: Using
|
🚁 Workaround2: Configuring module transpilationThough I spent peaceful days with the workaround1, this issue happened again when I added react-spring/drei to my app!😫🌧 😷 SymptomsWhile Next.js dev server was running, I added react-spring/drei by
Then I upgraded all the 💊 SolutionReferring to the PR merged into the Next.js three-js example (vercel/next.js#14864), I added a module martpie/next-transpile-modules and put the following transpilation settings in const withTM = require('next-transpile-modules')([
'drei',
'three',
'postprocessing',
]);
module.exports = withTM(); Note that this way pops some warnings in the terminal like these:
In this moment I ignore these warnings and just keep them in mind as I don't know absolutely how serious the performance of Babel is onto my app. But I'll stay awared...🙄 |
👾 Background
I'm using
OrbitControls
in a Next.js app with react-three-fiber. The moduleOrbitControls
is provided from Three.js 'three/jsm' so put the following import statement, but it doesn't work and raises:Any workarounds?
The text was updated successfully, but these errors were encountered: