The documentation for IdentifyTask in the 4.X SDK says:
IdentifyTask is not supported if attempting to be used:
- in a 3D SceneView
- with dynamic layers
That said, the JS API only provides a wrapper around the REST API here. The real functionality to handle this stuff is on the server so there's no reason you can't write your own function to make an identify request (probably using esri/Request) which includes dynamicLayers. The REST API documentation should be useful if you decide to do this.
Okay, thanks. I should have noticed that. I wonder if it will be supported in the future of if they are steering away from this type of request. Regardless, I can build the request manually as you suggested. Thanks again.