Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined

I found that using import { useBlockProps, MediaPlaceholder } from ‘@wordpress/block-editor’; import { TextControl, __experimentalNumberControl as NumberControl } from ‘@wordpress/components’; instead of import { TextControl, NumberControl, MediaPlaceholder } from ‘@wordpress/components’; resolved the problem.