JammyG
JammyG
Explore posts from servers
CDCloudflare Developers
Created by JammyG on 2/23/2025 in #pages-help
Pages functions advanced mode help
Any advice on this would be appreciated.
9 replies
CDCloudflare Developers
Created by JammyG on 2/23/2025 in #pages-help
Pages functions advanced mode help
running wrangler types generates types for my DB and secrets
// Generated by Wrangler by running `wrangler types`

interface Env {
SECRET_KEY: string;
DB: D1Database;
}
// Generated by Wrangler by running `wrangler types`

interface Env {
SECRET_KEY: string;
DB: D1Database;
}
but it deletes the interface I need for
interface Env {
ASSETS: Fetcher;
}
interface Env {
ASSETS: Fetcher;
}
Every time i run it which makes me think i'm doing something wrong. Also when I try to put my secrets using wrangler, it tells me I dont have a worker and suggests creating one.
9 replies
CDCloudflare Developers
Created by JammyG on 2/23/2025 in #pages-help
Pages functions advanced mode help
How do I handle using secrets and types in Advanced mode?
9 replies
CDCloudflare Developers
Created by JammyG on 2/23/2025 in #pages-help
Pages functions advanced mode help
Okay it's working now, I wish there was a bit more documentation on Advanced mode. The default package.json generated by wrangler runs:
"build": "tsc -b && vite build"
"build": "tsc -b && vite build"
Which builds the _worker.ts file, but is then immediatley deleted by vite
"build": "vite build && tsc -b"
"build": "vite build && tsc -b"
Flipping them around fixes it (I think) I hope this doesn't cause some weird behaviour .
9 replies
CDCloudflare Developers
Created by JammyG on 2/23/2025 in #pages-help
Pages functions advanced mode help
when i run npm run build locally, the _worker.js file is output to dist. But I can't see the file in my actual deployment, and no functions are being created either.
9 replies
CDCloudflare Developers
Created by JammyG on 2/23/2025 in #pages-help
Pages functions advanced mode help
No description
9 replies
CDCloudflare Developers
Created by JammyG on 2/23/2025 in #pages-help
Pages functions advanced mode help
No description
9 replies
CDCloudflare Developers
Created by JammyG on 2/23/2025 in #pages-help
Pages functions advanced mode help
ok, I made this
// tsconfig.worker.json
{
"extends": "./tsconfig.node.json",
"compilerOptions": {
"moduleResolution": "nodenext",
"module": "NodeNext",
"target": "es2022",
"noEmit": false,
"outDir": "./dist",
"allowImportingTsExtensions": false,
"types": [
"@cloudflare/workers-types"
]
},
"include": [
"worker-src"
]
}
// tsconfig.worker.json
{
"extends": "./tsconfig.node.json",
"compilerOptions": {
"moduleResolution": "nodenext",
"module": "NodeNext",
"target": "es2022",
"noEmit": false,
"outDir": "./dist",
"allowImportingTsExtensions": false,
"types": [
"@cloudflare/workers-types"
]
},
"include": [
"worker-src"
]
}
now when I run build it outputs a _worker.js file into /dist But it's not being picked up by Pages
9 replies
CC#
Created by JammyG on 5/3/2024 in #help
no such table
Okay, thank you
40 replies
CC#
Created by JammyG on 5/3/2024 in #help
no such table
i'm not entirely sure why/ whats going on behind the scenes though. Will these be fine to do for a small database?
40 replies
CC#
Created by JammyG on 5/3/2024 in #help
no such table
doing this fixes it. It works now
40 replies
CC#
Created by JammyG on 5/3/2024 in #help
no such table
No description
40 replies
CC#
Created by JammyG on 5/3/2024 in #help
no such table
Where should I put the database? If i want it to work on another machine
40 replies
CC#
Created by JammyG on 5/3/2024 in #help
no such table
No description
40 replies
CC#
Created by JammyG on 5/3/2024 in #help
no such table
yeah, if I open the db file it has the table in it
40 replies
CC#
Created by JammyG on 5/3/2024 in #help
no such table
that's true
40 replies
CC#
Created by JammyG on 5/3/2024 in #help
no such table
It's not going anywhere, its a beginner project
40 replies
CC#
Created by JammyG on 1/31/2024 in #help
Calling methods from a base class
Thank you for your help
148 replies
CC#
Created by JammyG on 1/31/2024 in #help
Calling methods from a base class
yeah that's the only method that's different
148 replies
CC#
Created by JammyG on 1/31/2024 in #help
Calling methods from a base class
so if 'class ComputerStudent' didnt exist at all
148 replies