Simple material exported from Blender does not receive shadows

Apologies for the newbie question but…

In a simplified example, if I draw a plane with a MeshStandardMaterial in three.js it receives shadows fine.

If I draw a cube in Blender, set a colour, and export to .glb (using all the default settings), the imported object does not receive shadows. It also responds to light differently. The imported object also has a MeshStandardMaterial, but the property that is different is that ‘flatShading’ is set to true.

If I set flatShading to false the object appears black.

Unfortunately for the real object I need a more complex geometry which has been drawn in Blender.

I would be phenomenally appreciative if someone could explain what is happening, and more importantly, how to get the geometry I need with a basic colour that receives shadows.

you have to traverse all the objects in the gltf.scene you’ve imported and individually set them to cast or receive shadows.
See code in this example where the scene is loaded: Raycaster Mouse Picking - Three.js Tutorials

Thanks for the response, but I have already done that. I have been able to explicitly narrow down the issue to the fact the that flatShading is set on the material, and that there is something about the exported/imported geometry that means that turning flatShading off turns the object black.

Sounds like an issue with the normals.
Try to invert them in Blender. Or traverse the object and compute normals for all the geometries: scene.traverse( object => object.geometry.computeVertexNormals ). Also check if the object’s materials are exported with a normal map.