I believe that the problem lies in the external resources that you might be using and referencing in your Coded Component script. Try following the instructions under Content Security Policy in the article here:
It is weird because in this coded component I am not using any external resource. I attach some screenshots here so you can see how the coded component looks like:
As I have understood, what was triggering the error was setting the event listener onclick to an HTML element in the way that is shown in the screenshot with Javascript.