Open hermesalvesbr opened 1 year ago
In order to make it work with CF workers you need to use nuxi build
instead of generate. Generate command will not create service worker. It seems that you used generate to deploy in CF Workers.
Try using yarn nuxi build
. Then you can confirm that sw.js
is exists inside .output/public
directory
Yes, with CF Workers, work's fine. But i can't to use content with CF PAges?
Oh my bad, I meant CF Pages
Just test it with yarn nuxi build
, it should solve the issue
Environment
Reproduction
I'm trying to deploy the nuxt content project for cloudflare pages, i have another project with Nuxt v3, but without nuxt content.
I have tried various nuxt configs, with preset service worker also base path for /content, but, didn´t work.
Describe the bug
I put online for some analysis: https://alpha.bodoco-site.pages.dev/noticias/
Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('https://alpha.bodoco-site.pages.dev/') with script ('https://alpha.bodoco-site.pages.dev/sw.js'): A bad HTTP response code (404) was received when fetching the script.
https://content.nuxtjs.org/guide/deploy/static-hosting https://content.nuxtjs.org/api/configuration/
With configuration base for /_content/ they show me 404 for this url https://alpha.bodoco-site.pages.dev/api/_content/navigation?_params={}
Without base show me 404 for path route.
Additional context
No response
Logs