Hey everyone 👋
I’m getting a 500 SSR error in production and can’t figure out why.
🐛 The issue
Error: 500 - Cannot read properties of undefined (reading 'console')
Occurs: Only on direct access to / or when refreshing the page
Works fine: When navigating from /login → /
I'm redirecting from login -> home fine, but refreshing breaks
Environment: Nuxt 4.1.2 on Cloudflare Pages (preset: cloudflare-pages)
🔍 Reproduction
You can check it here:
🔗 Repo: https://github.com/ElvinKyungu/linear-nuxt-fullstack/tree/develop
🌐 Preview: https://f7864481.linear-nuxt-fullstack.pages.dev/
❓ Questions
Should useToast() from @nuxt/ui work in SSR?
Is there a better pattern for handling toasts inside stores used in SSR?
Could a global middleware cause SSR store initialization issues?
Thanks a lot for your help! 🙏