Fireflies when using directional light

I’m having issues with fireflies when using directional light. When I tried using ambient light, this did not happen.

Here is the issue:


I read that increasing size of light source can solve this, but I had no luck. Here’s how I’m adding light:

    const light = new THREE.DirectionalLight(0xffffff, 1); = -3000; = 3000; = 3500; = -3000;
    light.castShadow = true;

    light.shadow.mapSize.x = 2048
    light.shadow.mapSize.y = 2048


Also, the code for setting the size of the light doesn’t seem to work.

light.castShadow = false;
or you have roughness=0.1, shininness=300 into material

That did it. Thanks.