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

Cannot read properties of null (reading 'style') #20

Open
vuong-nguyen-saltovn opened this issue Jun 15, 2022 · 5 comments
Open

Cannot read properties of null (reading 'style') #20

vuong-nguyen-saltovn opened this issue Jun 15, 2022 · 5 comments

Comments

@vuong-nguyen-saltovn
Copy link

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

image

Thanks all

@rafelis1997
Copy link

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

@vuong-nguyen-saltovn
Copy link
Author

vuong-nguyen-saltovn commented Jun 20, 2022

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

@rafelis1997
Copy link

rafelis1997 commented Jun 20, 2022

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

https://joukod.csb.app/

@vuong-nguyen-saltovn
Copy link
Author

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

https://joukod.csb.app/

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

@dperezbarreiro
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants