what am I doing wrong

I am new to cloudflare but not development.
I understand the differences between
worker sites
worker KV etc.
I understand the Cli and wrangler - they are installed and working fine.
However - when I generate a new worker say hello world git hub template (which works if published) If I the CHANGE the index.js file in ANY WAY it throws an error on publishing.
The Templates and boiler plate examples clearly state to PASTE code into worker script.
This just does not work, please what am I doing wrong.

Sorry you’re having a tough time!

It’s really hard to tell what’s going wrong without seeing the error message. Anything you can do to help other people re-create your problem would be very good.

OK thanks for the reply.
I will get a screenshot of the error from wrangler.

I am guessing there is a problem with me not cloudflare worker, but I tried everything.

I cannot get any boiler plate template to work unless you pass wrangler a github url for the template.

If I change ANY template in any way I get the error.