Editorv4.0 use API : scene.debugLayer.show() ,get error

Welcome aboard!

This may help you: