White screen when loading texture with Three.js

Viewed 134

Im working with three.js and i have some animations going, now i want to have a texture on a point, im running a local host with vite, and everything is working fine but as soon as i write this code my html page goes white? Even if i have not added the letter variable to ANYTHING yet?

const loader = new THREE.TextureLoader().load();

const letter = loader.load('img/q.png');

1 Answers

There is an error in your code (you are calling load() twice). Try it like so:

const loader = new THREE.TextureLoader();
const letter = loader.load('img/q.png');
Related