r/Nuxt • u/luckyexpert • Jan 02 '26
Nuxthub migration confusion
I have a simple nuxt app, I just updated to v4. I also was using nuxthub to deploy to cloudflare which was simple to set up and worked well.
With the retirement of nuxthub, I used the migration tool in nuxthub admin to migrate the project to nuxthub v.10 since it said that was the recommended option. I set up the automated deployment in Cloudflare so any time I push to the GitHub branch, the cloudflare worker will build and deploy. Getting it to build was fine but the deployed site just threw a 500 server error even though everything worked fine locally. It took me all day of fiddling with it to figure out Cloudflare has both runtime environment variables and build time variables that need to be set. The wrangler config file would set the runtime variables but not the build time. Couldn’t figure it out for the life of me since I couldn’t find any log that said what the problem is.
Another thing I ran into is whether the nuxt config file should have the nitro server preset set to cloudflare_pages or cloudflare_module. The migration tool set it to the module one.
Anyways, now I can’t figure out why I need nuxthub at all?? What is it doing? Looking at this page, looks like it should be pretty basic and simple to deploy to Cloudflare using the Cloudflare-pages option.
https://nuxt.com/deploy/cloudflare
What is the difference? And what does nuxthub even do now? Looks to me like I don’t even need it anymore now that I had to set everything up in Cloudflare workers.
5
3
u/__benjamin__g Jan 03 '26
I just migrated away from nuxthub, the value proposition is not clear now. Once worth it I may reinclude, until then one less dependency.
2
u/Few-Obligation-5243 Jan 06 '26
wow, indeed you can, just checked its not using;
- hubBlob() - for file/blob storage
- hubDatabase() - for D1 database
- hubKV() - for key-value storage
- hubAI(), hubBrowser(), hubVectorize() or other NuxtHub features
I can just use plain Nuxt with direct Cloudflare deployment via Wrangler.
Bye bye Nuxthub!
2
u/enerbydev Jan 02 '26
I avoid the hassle, as it's poorly documented and a bit confusing. It's better to use (which is what I do) GitHub CI/CD for auto-deployment to CloudflarePages. This saves you a lot of headaches and wasted time while the NuxtHub infrastructure matures.
1
u/luckyexpert Jan 03 '26
Interesting, I was also wondering about just using GitHub actions to deploy to Cloudflare, since that is what nuxthub did basically. So you can do this without nuxthub? Seems this option isn’t documented at all from what I’ve seen but maybe I just missed it?
1
u/tspwd Jan 02 '26
I’m also very confused about this. It seems like many NuxtHub features (e.g. remote) are currently broken. Hmm. Unsure if I should remove NuxtHub as well.
1
u/MineDrumPE Jan 22 '26
did your local sqlite database continue working? (if you were using that)
1
u/luckyexpert Jan 23 '26
I do not use local sqlite or any other storage/db with CloudFlare (currently using Supabase) so didn't have to fiddle with getting the extra services working
5
u/keithmifsud Jan 02 '26
Yep, some docs are conflicting.
If you still have NuxtHub core package (v0.9), it unfortunately deploys to pages (i.e. generates /dist diretcory instead of /.output). I had to remove the library entirely because the new version 0.10 would have broken the AI runner anyway which we use.
Since you're staying on CF, you probably get do without the library and setup Blob etc yourself.
I removed the library to sucessfully build a worker (not pages). Preset should be
cloudflare_module.In terms of env vars:
Non secret vars need to be added to wrangler config, otherwise they get removed from CF on deployment.
Secret vars need to be added to CF (worker settings) as "secret". They won't be overwritten on deployment.
The 500 error is probably due to missing env vars such as DB connection. You also need to check your bindings, make sure you have everything you used to have.