back to

If you are getting the following error: WebGL: INVALID_VALUE: texImage2D: invalid image when trying to run a WebGL program, it probably means your assets haven’t been loaded yet. Images and other external assets load asynchronously in the browser and you should should wait for them to complete before attempting to use them.

I have been bitten by this twice so I put this up here to ease the frustration in the future.


Using deferreds and promises is the best way in my opinion. Once you get hang of it it’s pretty easy to implement and extend.

For feedback email to