AGill
AGill
Explore posts from servers
CDCloudflare Developers
Created by AGill on 3/2/2025 in #pages-help
Real-Time Logs not showing error responses
I'm trying to debug an issue with some sporadic errors which result in a 401 api response from my pages function. When using the Real-Time Logs stream, all 200 OK responses come through but the 401 error responses do not. How can I get all api responses to show? Would it be framework specific? I'm using Nuxt3 and have logging on all requests, responses and errors through Nitro hooks api.
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('request', (event) => {
console.log('Request', event.method, event.path);
});

nitroApp.hooks.hook('beforeResponse', (event, { body }) => {
console.log('Response', event.method, event.path, { body });
});

nitroApp.hooks.hook('error', (error, { event }) => {
console.error(
`${event?.path || 'Undefined Server Event'} Application error:`,
error,
);
});
});
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('request', (event) => {
console.log('Request', event.method, event.path);
});

nitroApp.hooks.hook('beforeResponse', (event, { body }) => {
console.log('Response', event.method, event.path, { body });
});

nitroApp.hooks.hook('error', (error, { event }) => {
console.error(
`${event?.path || 'Undefined Server Event'} Application error:`,
error,
);
});
});
11 replies
CDCloudflare Developers
Created by AGill on 10/4/2024 in #pages-help
[Nuxt] Unable to load env vars when nodejs_compat flag enabled
For my Nuxt3 app on CF Pages, if I enable the nodejs_compat flag, the environment variables returned from useRuntimeConfig do not return the correct values. (compatibility date 2024-09-27) The correct values are the ones I set in my cloudflare project dashboard. Instead I am getting the default values as defined in my nuxt.config.ts file. Here is an issue I made describing the issue in more detail: https://github.com/nuxt/nuxt/issues/29188 Deployed website: https://useruntimeconfig-repro.pages.dev/ Repo Nuxt Config: https://github.com/Amar-Gill/useruntimeconfig-repro/blob/main/nuxt.config.ts So when visiting the site, I expect to see: client side env var: testing-public-env-var server side env var: this-is-a-test-value Instead I see default values: client side env var: xyzabc server side env var: abc123
4 replies
CDCloudflare Developers
Created by AGill on 9/24/2024 in #general-help
Just Purchased Workers Paid Plan but dashboard shows free plan still
I purchased the $5 a month Workers Paid plan. And I see that my invoice is paid in my billing page. But my dashboard still shows that I am on the free plan. I tried refreshing the page. And logging out / in. And clearing out site data as well. Is there a time period I have to wait before the plan is activated?
5 replies
NNuxt
Created by AGill on 5/26/2024 in #❓・help
type error for partial :ui prop
No description
1 replies
DTDrizzle Team
Created by AGill on 8/23/2023 in #help
Automatically apply migrations on serverless deploy
I've got a basic Todo app using Turso DB and Nuxt: https://github.com/Amar-Gill/nuxt-todo I'm wondering if there is a way to automatically apply migrations when I deploy to Vercel? The build command is npm run build. Right now, I open a shell into my Turso DB and paste the migration scripts. I might have to wait for a migration runner in drizzle-kit to ship: https://orm.drizzle.team/kit-docs/faq#how-do-i-apply-migrations-generated-by-drizzle-kit
4 replies