react-three-arjs icon indicating copy to clipboard operation
react-three-arjs copied to clipboard

Cannot read properties of null (reading 'style')

Open vuong-nguyen-saltovn opened this issue 3 years ago • 5 comments

Hi everyone, I'm using this lib in nextjs , how can I fix this error ?

image

Thanks all

vuong-nguyen-saltovn avatar Jun 15 '22 02:06 vuong-nguyen-saltovn

can you post the code, we can help much without knowing what you have made in code

rafelis1997 avatar Jun 18 '22 03:06 rafelis1997

import { ARCanvas, ARMarker } from "@artcom/react-three-arjs" import { Canvas } from '@react-three/fiber' import { useState } from 'react' export default function ARHiro() { const [isShow, setShow] = useState(false) const onClickImage = () => { setShow(true) alert("CLICKED ME!") } return <ARCanvas camera={{ position: [0, 0, 0] }} dpr={0.5} onCreated={({ gl }: any) => { gl.setSize(250, 250) }}

}

can you post the code, we can help much without knowing what you have made in code

this code only error when I started project with my IP's for host ( yarn dev -H a.b.c.d

vuong-nguyen-saltovn avatar Jun 20 '22 01:06 vuong-nguyen-saltovn

That's odd, your code is working fine on codesandbox

https://joukod.csb.app/

rafelis1997 avatar Jun 20 '22 03:06 rafelis1997

That's odd, your code is working fine on codesandbox

https://joukod.csb.app/

Maybe some conflict in my config , thanks for your help >__<

vuong-nguyen-saltovn avatar Jun 21 '22 07:06 vuong-nguyen-saltovn

I had the same issue. Hosting the app using https fixed the problem for me.

dperezbarreiro avatar Sep 01 '22 23:09 dperezbarreiro