question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue in NextJS 12

See original GitHub issue

Hi

this code in index.js

import { useRef, useState } from 'react'
import { Canvas, useFrame } from '@react-three/fiber'
import { VRCanvas } from '@react-three/xr'

function Box(props) {
  // This reference gives us direct access to the THREE.Mesh object
  const ref = useRef()
  // Hold state for hovered and clicked events
  const [hovered, hover] = useState(false)
  const [clicked, click] = useState(false)
  // Subscribe this component to the render-loop, rotate the mesh every frame
  useFrame((state, delta) => (ref.current.rotation.x += 0.01))
  // Return the view, these are regular Threejs elements expressed in JSX
  return (
    <mesh
      {...props}
      ref={ref}
      scale={clicked ? 1.5 : 1}
      onClick={(event) => click(!clicked)}
      onPointerOver={(event) => hover(true)}
      onPointerOut={(event) => hover(false)}>
      <boxGeometry args={[1, 1, 1]} />
      <meshStandardMaterial color={hovered ? 'hotpink' : 'orange'} />
    </mesh>
  )
}

export default ()=>{

  return (
    <VRCanvas>
      <ambientLight />
      <pointLight position={[10, 10, 10]} />
      <Box position={[-1.2, 0, 0]} />
      <Box position={[1.2, 0, 0]} />
    </VRCanvas>
  )

}

produces this console error:

Uncaught     at C:\Users\61420\curious_toy\website\node_modules\ (webxr-input-profiles\motion-controllers\dist\motion-controllers.module.js:397)
    at wrapSafe (internal/modules/cjs/loader.js:988:16)
    at Module._compile (internal/modules/cjs/loader.js:1036:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (file://C:\Users\61420\curious_toy\website\node_modules\@react-three\xr\dist\index.cjs.js:10:25)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
CodyJasonBennettcommented, Mar 29, 2022

Fix published in 3.5.0.

2reactions
verekiacommented, Mar 15, 2022

I confirm that @codyjasonbennett/xr@3.4.1 solved the issue for me 😃 Great work. Any idea when we could get an official release? Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · vercel/next.js - GitHub
Issues list · Error when build in nx monorepo · --turbo flag doesn't work with docker compose, but work when use only docker...
Read more >
Blog - Next.js 12
Next.js 12 introduces a brand-new Rust compiler, Middleware (beta), React 18 Support, Native ESM Support, URL Imports, React Server ...
Read more >
Next.js 12 - 5 Changes You Should Pay Close Attention To ...
Before we dive deeper into the topic, we will mention, that the new features will be opt-in. You will have to place your...
Read more >
Lazar Nikolov on Twitter: "Hey folks! If you're using #nextjs 12 ...
make sure to disable esmExternals in next.config.js. This is a temporary fix. Image. 6:48 PM · Oct 30, 2021 ·Twitter Web App.
Read more >
What's new in Next.js 12 - LogRocket Blog
One of the key features of Next 12 is performance optimization. To boost performance, Next.js replaced the Babel compiler with an extensible ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found