CaptainNemo
CaptainNemo
Explore posts from servers
CDCloudflare Developers
Created by CaptainNemo on 8/17/2024 in #pages-help
Map subdomain of main site's domain to branch deployment
I have a project at project-name.com and a branch deployment at preview.project-name.pages.dev. I'd like to make this specific branch deployment accessible via preview.project-name.com. Is that possible? What I've tried: I added preview.project-name.com as a custom domain, and then modified the CNAME record to point to preview.project-name.pages.dev instead of project-name.pages.dev. But it still takes me to project-name.pages.dev; I'm not seeing the preview deployment version.
2 replies
CDCloudflare Developers
Created by CaptainNemo on 4/17/2024 in #pages-help
Deploying Pages with D1 Binding via Wrangler.toml and GH Action
I've got a SvelteKit application deployed to Pages+Functions using the @sveltekit/adapter-cloudflare adapter and the cloudflare/pages-action GitHub Actions action. I've confirmed that invoking API endpoints runs a Function as it should, both locally (via npm run dev) and on prod. I'm now trying to add a D1 database. I've added the binding to my wrangler.toml file, and it works great locally (which is awesome 🤩), but even after deploying the schema to the remote DB via the CLI, the D1 binding in the Function does not work on my branch deploy. I suspect this is because the pages-action doesn't pick up the wrangler.toml, so I tried to switch to the wrangler-action, but I haven't figured out how to get it to deploy both the pages site and the D1 binding. The docs suggest configuring the binding via the dashboard but I'd like to keep it in my wrangler.toml so I have one source of truth, if possible. The diff of the PR where I've made these changes is here: https://github.com/tylermercer/log-thing/pull/4/files/155fe21a260815b0607712ab0b51d0c627982a6d My deployment: https://433388eb.log-thing.pages.dev/ The D1 test route showing the failed binding (which causes a 500): https://433388eb.log-thing.pages.dev/app/guestbook Deployment ID: 433388eb-4769-41d9-9dbd-56583c4a2014 Account ID: 191456bbc4d963669ab6dd59c256d84a
10 replies
CCConvex Community
Created by CaptainNemo on 8/2/2023 in #support-community
Convex dev errors because of MDX types in Astro
I have an Astro project with a Preact component in it, and I'm using Convex in that component, following the React Quickstart on the Convex docs. But I get this error when I run npx convex dev:
node_modules/@types/mdx/types.d.ts:22:19 - error TS2503: Cannot find namespace 'JSX'.

22 [Key in keyof JSX.IntrinsicElements]?: Component<JSX.IntrinsicElements[Key]>;
~~~
node_modules/@types/mdx/types.d.ts:22:19 - error TS2503: Cannot find namespace 'JSX'.

22 [Key in keyof JSX.IntrinsicElements]?: Component<JSX.IntrinsicElements[Key]>;
~~~
The bizarre thing is that it did work at one point, so I can actually run the whole project and it runs fine (because the generated types exist). But I can't get it to work anymore, so future changes to my schema are not picked up. Even stepping back in my git history to when it definitely worked does not fix it. I'm new to Convex, so maybe I'm missing something obvious like clearing a .gitignored folder or something. (I don't see any obvious culprits in my .gitignore though.) I loved the wind-in-my-hair feeling of running npx convex dev the first time, when it set up my project for me and everything, but this error is the opposite of that. :/ Feeling very stuck.
7 replies