This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 477
[nextjs] Importing OrbitControls resulting to "SyntaxError: Cannot use import statement outside a module" #2059
Comments
5ervant
changed the title
[nextjs] Importing OrbitControls resulting to SyntaxError: Cannot use import statement outside a module
[nextjs] Importing OrbitControls resulting to "SyntaxError: Cannot use import statement outside a module"
May 4, 2020
5ervant
changed the title
[nextjs] Importing OrbitControls resulting to "SyntaxError: Cannot use import statement outside a module"
[nextjs] Importing OrbitControls resulting to May 4, 2020
SyntaxError: Cannot use import statement outside a module
5ervant
changed the title
[nextjs] Importing OrbitControls resulting to
[nextjs] Importing OrbitControls resulting to "SyntaxError: Cannot use import statement outside a module"
May 4, 2020
SyntaxError: Cannot use import statement outside a module
This is try to implement and pray. "setupRegTHREE.js":
Component's code:
|
for me it works. |
Didn't work for me, the error is "OrbitControls is not exported from 'three' " |
I think it's a problem with Next.Js's SSR, I've tried:
This is what fixed it for me: in index.js
The Key is the SSR: false in the dynamic import |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
I'm implementing
OrbitControls
withreact-three-fiber
: https://codesandbox.io/s/41zwrI will just use
react-native-webview
to support the Expo native version of my Next.js app with Expo for web using@expo/next-adapter
.Behavior
However, it's raising this error when I
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
:Environment
Reference
The text was updated successfully, but these errors were encountered: