Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Defining DPR leads to error #4

Open
samevision opened this issue Apr 24, 2023 · 4 comments
Open

Defining DPR leads to error #4

samevision opened this issue Apr 24, 2023 · 4 comments

Comments

@samevision
Copy link

Hi,

if you set the dpr prop of Canvas - e.g. dpr={[1, 2]} - it throws the following error:

Failed to set the 'width' property on 'OffscreenCanvas': Value is not of type 'unsigned long'.
    at WebGLRenderer.setSize (webpack-internal:///(app-client)/./node_modules/three/build/three.module.js:28279:17)
    at WebGLRenderer.setPixelRatio (webpack-internal:///(app-client)/./node_modules/three/build/three.module.js:28257:9)

Best

@drcmda
Copy link
Member

drcmda commented Apr 24, 2023

are you trying last version? it seems to work

@samevision
Copy link
Author

Yes, I am on 0.0.5. It seems to work fine but it is throwing the error mentioned above as soon as I set the parameter.

@drcmda
Copy link
Member

drcmda commented Apr 24, 2023

how do you set it, by hot reload? is it OK on the first load?

@samevision
Copy link
Author

My canvas looks like this:

<Canvas
    dpr={[1, 2]}
    worker={worker}
    fallback={<Scene />}
/>

I am using nextjs but the error appears in dev environment as well as after build in production. So hot reload shouldn't be a problem.

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

No branches or pull requests

2 participants