chirsz-ever / deno-webgpu-window-demos

use deno to display WebGPU demos
Boost Software License 1.0
18 stars 0 forks source link

Three.js -self is not defined #4

Open oo0o00oo0 opened 3 weeks ago

oo0o00oo0 commented 3 weeks ago

Thanks for creating these demos! I am wondering how its possible to deal with "ReferenceError: self is not defined"?

$ deno run -A threejs/webgpu_backdrop.js error: Uncaught (in promise) ReferenceError: self is not defined at file:///C:/Users/~/AppData/Local/deno/npm/registry.npmjs.org/three/0.165.0/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js:20:24

chirsz-ever commented 3 weeks ago

This is a Deno or V8 bug: https://github.com/denoland/deno/issues/24683

You can use deno upgrade --version 1.45.2 to roll back your deno version.

And, for run it successfully, your should download the SDL.dll form SDL releases (on Windows in most cases you should download SDL2-version-win32-x64.zip) and then put it to the project's root path.

I would try to fix this problem (not soon). PR to fix this problem is welcome.