/give an enchanted sword results in 'Component was not an object' error in Bedrock/Pocket Edition? [duplicate]

I'm attempting to give a player an enchanted sword using the following command:

/give @p diamond_sword 1 0 {"ench":[{"id":5,"lvl":1}]}

Why do I see this error?

This copied from example for Bedrock Edition, but not working.

Command Block


Solution 1:

The only "components" supported are can_place_on and can_break. Nothing else. You will have to externally edit items (MCC Toolchest PE, Universal Minecraft editor, etc.) or just enchant them ingame.