Canvas app code component error "Couldn't import components"
If you are developing code components (PCF) for canvas apps you'll be used to using the 'Get more components' panel. When adding the code-component to the canvas app, occasionally you will receive the somewhat unhelpful error:
Couldn't import components
There are no more details provided in the expanded down arrow area:

I'm putting this here for my future self (who always seems to forget about this issue) and anyone else who comes across this error.
The cause is usually because you have a property-set that has the same name as an in-build property or one of your own (e.g. Enabled/Selected)
The resolution is simply to prefix your property-set names with the name of the data-set:
<data-set name="Items" ... > <property-set name="ItemsSelected" .. /> <property-set name="ItemsEnabled" .. /> </data-set>
Hope this helps!
Published on:
Learn moreWe can help you with Canvas app code component error "Couldn't import components"
If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.
Related posts
React 18 is not compatible with Fluent UI and how to work around it in PCF projects
React version 18 has recently been pushed into npm which is great if all of your components support it, however, if you are working with Flu...