Shader error in the section "lights_physical_fragment:"

Here is the line 9750 in three.js r137:
var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\n…

I saw the following shader error when using three.js r137:
ERROR: 0:747: ‘geometryNormal’ : undeclared identifier
ERROR: 0:747: ‘=’ : cannot convert from ‘highp float’ to ‘highp 3-component vector of float’

The second error came from this part: “dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) )”

Could you fix it?

Do you mind explaining in more detail how this error occurs? Are you using a custom shader material?

Yes, I am using custom shader materials as shown at icn3d/src/thirdparty/shader at master · ncbi/icn3d · GitHub. The example page is at iCn3D: Web-based 3D Structure Viewer. I fixed the three.js code by replacing “vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );” with “float geometryRoughness = 0.0”.