Open jswhisperer opened 1 month ago
Where do you deploy your project and with what command?
npx nuxthub deploy
Trying some hacking but feels dirty, can I keep the (dynamic) server routes, server rendered on nuxt hub?
import data from "./prisma/seeds.json";
const bookAPI = Object.fromEntries(
new Map(data.map(({ isbn }) => [`/api/book/${isbn}`, { prerender: true }]))
);
nuxtConfig....
routeRules: { ...bookAPI, "/api/books": { prerender: true, cors: true }, },
Also tried the experimental.. `defineRouteRules({ prerender: true });`
By looking at the console it seems you have a 500 on your API route
Thank you so much for taking the time to debug! I know you're a busy guy (we met at a meetup before dotjs in an opera house I think / Paris)
I think I need to rephrase my question, does NuxtHub support the node + Server/
routes as a hybrid app? If so what are the settings I need to do, ssr : false
I assume?
NuxtHub support hybrid rendering by default, no need to set ssr: false
🙂
we met at a meetup before dotjs in an opera house I think / Paris)
I don't remember well but I do hope we will meet again :)
Re-opening as the issue might be related to Prisma
I don't know if it's related, but when using Drizzle
after deploys I also have 500
.
On localhost even with remote
it works very well without errors.
I think you are correct it's a prisma issue.
Cannot run exec or something.
Prisma is so finicky.
Haven't tested but wondering is it because I'm using SQLite with a local file, maybe there is a permissions issue.
cc @oritwoen are you using drizzle with sqlite or remote (real) db?
Real database from Cloudflare using remote @jswhisperer On dev, i.e. nitro node preset, it works perfectly. With cloudflare-pages
preset, something is clearly building incorrectly or pollyfils is missing.
Super happy to test, I thought cloudflare-pages
was required with nuxt-hub
I managed to remove nuxt-hub and also deploy successfully . I'm ok to close this but is there documentation or how does one adjust the presets please.
Real database from Cloudflare using remote @jswhisperer On dev, i.e. nitro node preset, it works perfectly. With
cloudflare-pages
preset, something is clearly building incorrectly or pollyfils is missing.
Happy to close, could you specify how to change the presets... I didn't edit anything and it ran cloudflar-pages as a preset. My solution utimateley was to remove nuxt-hub and deploy elsewhere but not ideal obviously! :)
Article https://dev.to/jswhisperer/i-will-refuse-live-coding-interviews-from-now-on-3mfh heres the code if you want a peak https://github.com/gregpalaci/nuxt-demo-books and a preview https://lambent-fenglisu-27a5c4.netlify.app/
Describe the bug Server "Api" routes missing
https://nuxt-app-gregpalaci.nuxt.dev/ all good https://nuxt-app-gregpalaci.nuxt.dev/api/books MIA
codebase https://github.com/gregpalaci/nuxty-book MIA (https://github.com/gregpalaci/nuxty-book/blob/main/server/api/book/%5Bisbn%5D.ts)
Expected behavior API exists