pmndrs / react-three-offscreen

📺 Offscreen worker canvas for react-three-fiber

Home Page:https://offscreen.pmnd.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Defining DPR leads to error

samevision opened this issue · comments

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

commented

are you trying last version? it seems to work

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.

commented

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

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.