core icon indicating copy to clipboard operation
core copied to clipboard

Help about realtime

Open yusufalitangoz opened this issue 7 months ago • 11 comments

I renewed the NuxtHub token and enabled realtime as in the documentation. When I enter the website, I get a 404 error. Is there a config I'm missing or something?

yusufalitangoz avatar Apr 15 '25 07:04 yusufalitangoz

Could you please share a reproduction / video, quite hard to help you with few informations

atinux avatar Apr 15 '25 08:04 atinux

nuxt.config.ts hub: { database: true, workers: true, blob: true, kv: true, }, nitro: { experimental: { websocket: true, }, },

I enable realtime and i have a minimal websocket handler in server/api/websockets/chat.ts

After this i got error from nuxt/seo ogimage

10:07:24.387 [info] [nitro] Building Nuxt Nitro server (preset: cloudflare-durable, compatibility date: 2025-01-28) 10:08:18.411 [error] [nitro] Error: Cannot resolve "./resvgjs.android-arm-eabi.node" from "/opt/buildhome/repo/node_modules/@resvg/resvg-js/js-binding.js" and externals are not allowed!

And i disable og image for quick fix

ogImage: { enabled: false, },

Error gone but my website 404

https://github.com/user-attachments/assets/bd6a94d5-27ce-427e-8e7c-43b507a9368c

yusufalitangoz avatar Apr 15 '25 08:04 yusufalitangoz

Having the same error:

Run nuxt-hub/action@v1
  with:
    project-key: noction-parking-5k16
    directory: dist
    hub-url: https://admin.hub.nuxt.com/
  env:
    PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
Deploying noction-parking to production environment...
Error: Error while preparing deployment: "Please link a NuxtHub project with the \"worker\" type to deploy with the \"cloudflare_durable\" preset." - [POST] "https://admin.hub.nuxt.com/api/teams/50rayn/projects/noction-parking/production/deploy/worker/prepare": 400 Bad Request

Version: "@nuxthub/core": "0.8.24"

nuxt.config.ts :

  compatibilityDate: '2025-01-28',

  hub: {
    database: true,
    workers: true,
  },

  nitro: {
    experimental: {
      websocket: true,
      tasks: true,
    },
    scheduledTasks: {
      '*/30 * * * *': ['booking:cancel'],
    },
  },

50rayn avatar Apr 16 '25 14:04 50rayn

@50rayn Have you created a new project and selected Workers as the type?

RihanArfan avatar Apr 16 '25 19:04 RihanArfan

@RihanArfan Yes. I tried a setup like this with Cloudflare Workers. A completely new project with WSS and SSE. Link to the error: https://github.com/50rayn/nuxt-hub-test/actions/runs/14523304770/job/40749064043

50rayn avatar Apr 18 '25 07:04 50rayn

You'll need to set hub.workers to true https://github.com/50rayn/nuxt-hub-test/blob/main/nuxt.config.ts#L33

RihanArfan avatar Apr 23 '25 19:04 RihanArfan

@RihanArfan oki. set to true. On the next deployment it fails,

Error: Error while publishing deployment: "Actor migration tag precondition failed, got tag '' when expected tag is 'v1'. Please make sure the tags match and try again." - [POST] "https://admin.hub.nuxt.com/api/teams/50rayn/projects/nuxt-hub-test/production/deploy/worker/complete": 412 Precondition Failed

On life is the last, and the only successful deployment :D https://nuxt-hub-test.soryngitlan.workers.dev.

50rayn avatar Apr 23 '25 20:04 50rayn

We've rolled out some improvements to Durable Object migrations which was sometimes causing this. Can you check whether everything is working now?

RihanArfan avatar Apr 27 '25 16:04 RihanArfan

I still get 404 error, my environment is preview and zero trust is active

"dependencies": { "@nuxt/content": "2.13.4", "@nuxt/fonts": "^0.10.3", "@nuxt/image": "^1.9.0", "@nuxt/scripts": "0.9.5", "@nuxthub/core": "^0.8.25", "@nuxtjs/color-mode": "3.5.2", "@nuxtjs/device": "3.2.4", "@nuxtjs/fontaine": "^0.4.4", "@nuxtjs/i18n": "^9.5.2", "@nuxtjs/seo": "2.0.0-rc.23", "@nuxtjs/turnstile": "0.9.11", "@pinia/nuxt": "^0.7.0", "@tawk.to/tawk-messenger-vue-3": "^1.0.3", "@tresjs/cientos": "^4.1.0", "@tresjs/nuxt": "3.0.7", "@tsndr/cloudflare-worker-jwt": "^3.1.3", "@unovis/ts": "^1.5.1", "@unovis/vue": "^1.5.1", "@vee-validate/nuxt": "^4.15.0", "@vee-validate/zod": "^4.15.0", "@vueuse/motion": "^2.2.6", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cobe": "^0.6.3", "drizzle-orm": "^0.38.4", "embla-carousel-vue": "^8.5.2", "fcm-cloudflare-workers": "^2.0.0", "i18n-iso-countries": "^7.14.0", "jspdf": "^2.5.2", "jspdf-autotable": "^3.8.4", "lodash": "^4.17.21", "motion-v": "^0.11.0-beta.4", "nuxt": "^3.15.4", "nuxt-auth-utils": "0.5.7", "nuxt-security": "^2.1.5", "nuxt-svgo": "^4.0.14", "nuxt-vitalizer": "^0.10.0", "pinia": "^2.3.1", "reka-ui": "^2.2.0", "shadcn-nuxt": "^0.10.4", "tailwind-merge": "^3.0.2", "tailwindcss-animate": "^1.0.7", "three": "^0.171.0", "uuid": "^11.0.5", "validator": "^13.12.0", "vaul-vue": "^0.2.1", "vee-validate": "^4.15.0", "vue": "^3.5.13", "vue-router": "^4.5.0", "vue-use-spring": "^0.3.3", "vue3-map-chart": "^0.0.6", "zod": "^3.24.1" }, "devDependencies": { "@bg-dev/nuxt-fcm": "^0.2.14", "@iconify-json/lucide": "^1.2.35", "@nuxt/eslint": "^0.6.2", "@nuxt/icon": "^1.10.3", "@nuxtjs/tailwindcss": "^6.13.1", "@types/lodash": "^4.17.15", "@types/validator": "^13.12.2", "@vueuse/core": "^13.0.0", "@vueuse/nuxt": "^11.3.0", "@zadigetvoltaire/nuxt-well-known": "^0.0.13", "drizzle-kit": "^0.30.4", "eslint": "^9.19.0", "nitropack": "2.10.4", "prettier": "^3.4.2", "typescript": "^5.7.3", "vue-tsc": "^2.2.0", "wrangler": "^3.107.3" }

yusufalitangoz avatar Apr 28 '25 13:04 yusufalitangoz

@RihanArfan looks now works (page). The only thing which remains, the scheduled tasks don't work, but I think it's not related to real-time topics.

I just upgraded all the deps to the latest version.

50rayn avatar Apr 29 '25 15:04 50rayn

Is there any progress?

yusufalitangoz avatar May 19 '25 06:05 yusufalitangoz