I created a simple button component to test the code components framework. I build the solution and uploaded/published it successfully.
In a powerapp, after enabling components, I see my component in the import window. However, when I actually try to add it to my PowerApp I always get the error "Couldn't import components".
No other error message is displayed, and the component isn't added. Is there somewhere I can see what the actual issue is, and how I can solve this?
That issue should already be fixed and checked in, it's just the train it's on isn't available yet. Hopefully it will be available next week, but no guarantees.
Another issue related to this you may want to look into, @jopursle, is when a component cannot be imported (for whatever reason) during an update of the existing app, the error is NOT displayed which makes it difficult to detect and troubleshoot.
@TechnoKitty Thanks for the confirmation. I was able to find the error message at least that let me know that somewhere a Linq command was failing to find an element which narrowed it down a bit, but based on your info I think I know where it is happening.
It looks like import is still getting resources no longer directly referenced and then we fail on the check where all resources must be referenced by the manifest file.
I'll log a bug against myself to get this fixed. It shouldn't be that difficult to fix, but it will take a while to become available due to release schedules. For now, I'd advise not removing resources from a control (if using in Canvas) to get around this issue until a fix becomes available.
Thanks again @TechnoKitty for the info to track down the issue.
I think I can reproduce and fix* the issue now, @jopursle
If I remove any resource from the Manifest which was declared there previously (I tried CSS), then I cannot import the component - it fails with the error. If I put the resource back, the component imports successfully!
*) with the <img> it seems stuck because it doesn't work one way, neither the other when once added :))
Sure,
Session ID: b96eda80-dd74-4264-ad4b-e67b3a84aeef
PowerApps 3.20023.4
@TechnoKitty That's interesting it would still be having issues afterwards. I'll see if I can get a local repro doing similar steps tomorrow.
Would it be possible to get the session id from a Canvas session hitting the import issue so I can see if there is any extra information on why this happened?
Session Id can be found under "File>Account>Session details"
Thank you, @jopursle for looking into this and the advice on the managed solutions!
The component is for Canvas app, I didn't try in a model-driven one.
I tried the following and can report:
On the possible reasons (confession time) - I did try to use <img> resource. It successfully compiled and deployed, but I could not import. I removed the resource (in the manifest and project), but it didn't fix the import issue as per this thread until I renamed the component.
Looking at the project you provided, it looks like you are building the solution as unmanaged. Removing an unmanaged solution won't actually remove the components, which is a limitation to unmanaged whereas managed doesn't have this issue. Managed has other restrictions however as that's only really meant for deployment (although I still use it personally for testing as uninstalling is nice).
I can ask around for the best way to clean up the older files, but you can also try publishing a newer version and hitting "Publish all customizations". You can also change the name of the control and it will see it as a new control and won't have this issue.
If you can remember the steps on how you got to this state, that would be helpful as CDS shouldn't be having the control files in this state, whatever it is...
An update - I've tried to import the original component into another environment and it works!
So, somehow, the component became incompatible (?!) with my environment (if it helps it's instance id a37edd15-97c2-4d3b-a9a9-c71279cfe9d0 or https://orgb14a6e51.crm6.dynamics.com/) . How might I clean it? Removing solution doesn't help, the deployment still says the component is present in the environment.
I was able to import and use the control successfully, so it's nothing to do with the control itself.
I assume it probably has to do with the files stored in CDS. Are you able to use this control successfully with all the updated resources in Model or is this just a Canvas issue? Also, did you recently remove files from the project or uninstall/reinstalled the solution?
One thing you can try is update the control version again and republish. Afterwards click the "Publish all customizations" button, attempt to add the control to a new Canvas app and see if it repros again.
My best guess is that there is an unexpected file from the old version that is no longer expected.
WarrenBelz
85
Most Valuable Professional
Michael E. Gernaey
57
Super User 2025 Season 1
mmbr1606
55
Super User 2025 Season 1