-
Notifications
You must be signed in to change notification settings - Fork 699
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
Console error: "MeshReflectorMaterial" is not part of the THREE namespace! #271
Comments
Can you please provide an example of the code? Repo or Sandbox is fine. |
Hi, I downloaded the code from this sandbox: https://codesandbox.io/s/drei-reflector-bfplr And then ran npm install. Tested the demo using npm run-script start - is running fine. |
@joshuaellis i think it should explicitely do import '../materials/MeshReflectorMaterial' in Reflector.tsx the message above means that the extend wasn't executed for some reason. or at least by the time something tries to do <meshReflectorMaterial/> r3f had no known object for that. i think this is tree-shaking messing it up in production. it will remove MeshReflectorMaterial because it's never being used anywhere explicitely. |
Hi @joshuaellis, can confirm, build version works beautifully with 3.1.0-beta.1. |
three
version: 0.125.1react-three-fiber
version: 5.3.18@react-three/drei
version: 3.0.0-beta.6node
version: 14.13.0npm
(oryarn
) version: 6.14.8Problem description:
I downloaded the drei reflector demo, which is running fine as it is.
Then I run
npm run-script build
.The build process finishes successfully.
But opening the build in the browser throws an error and the scene remains black:
"MeshReflectorMaterial" is not part of the THREE namespace! Did you forget to extend it?
How can I create a successful build?
The text was updated successfully, but these errors were encountered: