sean
Explore posts from serversCDCloudflare Developers
•Created by sean on 4/18/2024 in #pages-help
Delete a Worker
This seems insane, I would like to delete two of my old Cloudflare Worker projects.
When I try to delete a deployment before deleting the project, it says "This deployment cannot be deleted because it is currently your active Production deployment"
So I tried to delete the project directly in the Manage tab, and it simply throws an error.
The repos don't even exist anymore!
1 replies
TTCTheo's Typesafe Cult
•Created by sean on 12/23/2023 in #questions
Disable route caching on page navigation
Using the page directory, I have a page (which is the main one) that fetches an API (server side) and displays the fetched data.
I also have another page I can navigate to, which simply has static content.
When I navigate from the static page to the page with data fetching I discovered that Next's router caches the page and doesn't do the server side fetching anymore.
Is there a way to disable this behavior? This seems forced and I'm finding it weird
2 replies
CDCloudflare Developers
•Created by sean on 11/22/2023 in #pages-help
Nuxt.js, Pnpm monorepo and Cloudflare pages
I'm trying to deploy a monorepo to Cloudflare pages. (Moving from Netlify)
I changed the config with Nitro, so now the build command is this one:
But, once it finishes building, I'm getting this error:
1 replies
TTCTheo's Typesafe Cult
•Created by sean on 9/25/2023 in #questions
Tailwind - Styles with same name but different value depending on the route
I am working on a monorepo. Each package in the monorepo counts has a route (e.g. the folder /page is the actual route that the users end up visiting with their browser)
The thing is that a lot of components are shared and just change small things about the style, for example all components in
/page
with the style rounded
should have a border-radius of 2px.
But I would like all rounded
classes in /page2
to have, for example, a border-radius of 4px.
Would that be possible?4 replies
Keep my repo online only during a certain time span
Hello! Would it be possible to keep online my repo only during a certain time of the day? (e.g. from 2AM to 7PM)
I was thinking about writing a simple GitHub action that sends an API request to start and stop my container, but I can't seem to find any API reference.
Thank you in advance
12 replies
TTCTheo's Typesafe Cult
•Created by sean on 6/27/2023 in #questions
Caching an entire API route for 5 minutes
Hi everyone! I was wondering if my Next.js API route (using the app directory) can be cached using Vercel as a server-side layer.
So, for example, if my api route returns something like:
I would like to see the same date for 5 minutes.
As of right now I tried following this: https://nextjs.org/docs/app/building-your-application/data-fetching/revalidating#on-demand-revalidation
Which does seem to be working if I'm using fetch, but it doesn't if I put
export const revalidate = 60
in my API route.
Thank you in advance to anyone who's willing to help! Cheers.3 replies
TTCTheo's Typesafe Cult
•Created by sean on 1/21/2023 in #questions
Force every value of union type in an array
Let's say that I had the following union type:
If I wanted to have an array that accepted a list of those values I would do something like this
Is there a way to force an error if the array doesn't contain all the values?
23 replies
TTCTheo's Typesafe Cult
•Created by sean on 1/4/2023 in #questions
[Solved] Conditional types
I was reading the TS docs but I can't seem to grasp this concept very well.
I have the following interface:
I want to let TypeScript know that my body is always available if "hasErrored" is false instead of checking if body exists in the first place.
Thank you in advance!
4 replies