TypeError: Cannot read properties of undefined (reading 'navigator')
I found the error message through Cloudflare's real-time logs: TypeError: Cannot read properties of undefined (reading 'navigator').
I deleted all the code using 'navigator' in the project, but after redeploying, the same issue still appears. I tested it with another small project. Could you please guide me or give me some hints? Thank you very much!
https://2f864bdb.image-splitter-5h0.pages.dev/grid-image-splitter
4 Replies
Hello,I found the error message through Cloudflare's real-time logs: TypeError: Cannot read properties of undefined (reading 'navigator'). I deleted all the code using 'navigator' in the project, but after redeploying, the same issue still appears. I tested it with another small project. Could you please guide me or give me some hints? Thank you very much!
This is Cloudflare's real-time logs.
Sounds like a lib or something is still using it
Your best bet is just looking through the built project and figuring out where it's coming from
The fact it's "Cannot read properties of undefined (reading 'navigator')." means it's
<something>.navigator
probably window.navigator
so some lib depending on browser windowThank you for your response, I found the problem, it was caused by a certain frontend component during backend rendering. I solved this issue using client-side rendering, but another tricky problem has arisen: ReferenceError: async__chunk_85236 is not defined. Please check the txt document for detailed errors.