Skip to content
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

TypeError: Cannot redefine property: _currentRenderer #2533

Closed
aniketbiprojit opened this issue Sep 27, 2022 · 9 comments · Fixed by #2534
Closed

TypeError: Cannot redefine property: _currentRenderer #2533

aniketbiprojit opened this issue Sep 27, 2022 · 9 comments · Fixed by #2534
Labels
bug Something isn't working

Comments

@aniketbiprojit
Copy link

Build fails with Cannot redefine property: _currentRenderer

Next Version: 12.3.1
@react-three/fiber: ^8.8.3
Three: ^0.144.0

const nextConfig = {
  reactStrictMode: true,
  swcMinify: true
}

const withTM = require('next-transpile-modules')(['three'])
module.exports = withTM(nextConfig)
<div style={{ width: '100vw', height: '100vh', color: 'black' }} className='box'>
  <Canvas>
	  <ambientLight intensity={0.1} />
	  <directionalLight color='blue' position={[0, 0, 5]} />
	  <mesh>
		  <boxGeometry />
		  <meshStandardMaterial />
	  </mesh>
  </Canvas>
</div>

image

@max-ch9i
Copy link

I can verify that the issue happens on @react-three/fiber versions 8.8.1 and greater.
Works as expected on 8.8.0.

@below-1
Copy link

below-1 commented Sep 27, 2022

Same here. And it only throws on production mode

@joshuaellis
Copy link
Member

Someone should provide a reproduction of this bug, if possible stackblitz, else a github repo. This reproduction should be a minimal example.

@max-ch9i
Copy link

max-ch9i commented Sep 27, 2022

Sharing stackblitz: https://stackblitz.com/edit/nextjs-hxd5if?file=pages/index.js

Run: npm install && npx next build && npx next start

@CodyJasonBennett
Copy link
Member

Published a quick fix in v8.8.6.

@max-ch9i
Copy link

Thanks @CodyJasonBennett . I can confirm <Canvas/> works fine for v8.8.6.

@max-ch9i
Copy link

Do you think protectwise/troika#220 is related?

@drcmda
Copy link
Member

drcmda commented Sep 27, 2022

doesn't look related to me.

@aniketbiprojit
Copy link
Author

Wow. That was quick. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants