Handle empty ESM client modules (#72404)
If an ESM module only includes a `'use client'` directive and no
exports, which is the case for one of the modules that are included in
`@chakra-ui/system` for example, we must not try to add
`registerClientReference` statements for this module. This is a
regression from #71968.
fixes #72358
closes #72359