How to solve: Got error: Uncaught ReferenceError: global is not defined

Hello, my deployment to cloudflare pages for my Nuxt app fails with the following error: 23:22:22.820 ✨ Upload complete! 23:22:25.222 Success: Assets published! 23:22:26.682 Error: Failed to publish your Function. Got error: Uncaught ReferenceError: global is not defined at chunks/runtime.mjs:1:30918 Building on my local machine works perfect, this are my deps: "dependencies": { "@headlessui/vue": "^1.7.19", "@heroicons/vue": "^2.1.3", "@tailwindcss/forms": "^0.5.7", "@nuxtjs/tailwindcss": "^6.11.4" }, "devDependencies": { "nuxt": "^3.11.1", "@nuxt/types": "^2.17.3", "@nuxtjs/supabase": "^1.2.0" } Any idea how to fix this?
1 Reply
drevan
drevan2mo ago
I seem to be experiencing the same. Can't seem to find any issues or reasons as to why. My Deps:
"dependencies": {
"@drevan/sanity": "workspace:*",
"@nuxtjs/color-mode": "^3.3.3",
"@nuxtjs/sanity": "^1.11.0",
"@nuxtjs/tailwindcss": "^6.11.4",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.12",
"nuxt-icon": "^0.6.10",
"tailwind-merge": "^2.2.2",
"tailwindcss": "^3.4.3",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@nuxt/test-utils": "^3.12.0",
"@nuxtjs/seo": "2.0.0-rc.10",
"dotenv": "^16.4.5",
"happy-dom": "^13.10.1",
"nuxt": "^3.11.2",
"typescript": "^5.4.4",
"vitest": "^1.4.0"
}
"dependencies": {
"@drevan/sanity": "workspace:*",
"@nuxtjs/color-mode": "^3.3.3",
"@nuxtjs/sanity": "^1.11.0",
"@nuxtjs/tailwindcss": "^6.11.4",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.12",
"nuxt-icon": "^0.6.10",
"tailwind-merge": "^2.2.2",
"tailwindcss": "^3.4.3",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@nuxt/test-utils": "^3.12.0",
"@nuxtjs/seo": "2.0.0-rc.10",
"dotenv": "^16.4.5",
"happy-dom": "^13.10.1",
"nuxt": "^3.11.2",
"typescript": "^5.4.4",
"vitest": "^1.4.0"
}
Interesting, see: https://discord.com/channels/473401852243869706/1229167725306449950/1229167725306449950