I think you have to import "@babylonjs/core/Culling/ray"; for picking
import "@babylonjs/core/Culling/ray";