Cloudflare Page results are different with DNS CNAME proxy

Hi. I have a qwik & Cloudflare Pages project using the build process outlined on the Cloudflare website. I also have 2 domain names https://qwik.stockideashq.com and https://www.stockideashq.com both CNAME to the same url https://stockideasweb.pages.dev. But on https://qwik.stockideashq.com (the one with CNAME proxy) it shows some error messages when you open the console, and all the links are not working correctly. The error message is

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘qc’).

Any suggestions how I can get around this issue? Thanks.

Did you add both names (qwik.stockideashq.com and www.stockideashq.com) as custom domains in your Pages project?

edit: Yes, it looks like you did. The difference is that one is proxied and the other isn’t, and it looks like the one that is proxied is stripping out things like HTML comments. In your Cloudflare dashboard go into Speed → Optimization and see if “Auto Minify” is turned on. If so, shut it off for Javascript; I have seen Javascript minification cause errors on code that is already minified.

1 Like

Thanks. It worked! I had to un-minify both html and js to make this work since I am already fetching html server side with this framework.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.