Country code redirect: Cannot read properties of undefined (reading 'country')

Hello, i used the example codefrom cloudflare to perform country-code-redirect https://developers.cloudflare.com/workers/examples/country-code-redirect

i’m stuck with a TypeError: Cannot read properties of undefined (reading ‘country’)

i have no idea what the problem is

The preview does not have the cf object. You would need to test this locally or deploy it and test there.

yes that’s it, thank you !

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