Uncaught SyntaxError: Unexpected token '*'

I’ve deployed my static website from github, and the cloudflare has provided the following url to my site
https://xxx.pages.dev
And this site works perfectly well.
But when I point my custom domain to it and visit the domain, it shows this error on the browser console:
Uncaught SyntaxError: Unexpected token '*'
I’ve set up dns record as follows on cloudflare pages’ dns management:

CNAME      @       xxx.pages.dev
CNAME    www     xxx.pages.dev

Hi @mahesh1,

Have you configured the custom domain in the pages settings?

Yes I have. You can see my configuration at the end of my post.

Can you share the domain name?

It seems a weird error to come from Pages…

These are the domains:
This is the domain that I own: iconweb.studio
This is the domain that is given by cloudflare after deploying pages: icon-web-studio.pages.dev

They both work for me, I see the error you mention, on some browsers. It’s most definitely an application issue, which is unrelated to Pages.

Well if its an application issue, it should throw error on icon-web-studio.pages.dev domain too right?
Why just error on iconweb.studio only? Where should we look for debugging?

FYI: If you refresh your page, the error can be reproduced for iconweb.studio

Let me reverse the question: if it is a Pages issue, shouldn’t it throw an error on the non CNAME version, as well? It’s literally just serving static files.

I can’t know your code… That’s not my concern here.

I know, in some browsers. Chrome works, for example. Safari does, until it gets to that specific part of the code.