TextureLoader in the web worker failed with this error:

Uncaught (in promise) TypeError: document.createElementNS is not a function

There are a few answers on the stackoverflow, but they are not definitive. I understand the “document” is inaccessible in the worker. But, why does the loader have to rely on the “document”?

The off-screen canvas is a mature concept in the threejs by now. The lack of textures significantly diminishes the off-screen capabilities, doesn’t it?

Right now, I have to use the RGBELoader to load an hdr file, then use the PMREMGenerator to get a cube map. From there, I do get a texture. That also means a texture is obtainable without a “document”, but just not with the vanilla version of the texture loader.

Could you please offer some advice of getting a background texture for an off-screen canvas without using an hdr file?

See Offscreen Canvas with Textures.