Pages functions advanced mode help
I want to merge my worker with a pages application using functions. I've read the docs and i'm still not sure how to structure the app/ how it works.
So _workers.ts needs to be compiled into dist?
How do I set this up using the configs, I have three. tsconfig.json, tsconfig.node.json and tsconfig.app.json. I had a go myself but when building I get " error TS6200: Definitions of the following identifiers conflict with those in another file"

4 Replies
ok, I made this
now when I run build it outputs a _worker.js file into /dist
But it's not being picked up by Pages


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.
Okay it's working now, I wish there was a bit more documentation on Advanced mode.
The default package.json generated by wrangler runs:
Which builds the _worker.ts file, but is then immediatley deleted by vite
Flipping them around fixes it (I think) I hope this doesn't cause some weird behaviour .
How do I handle using secrets and types in Advanced mode?
running wrangler types generates types for my DB and secrets
but it deletes the interface I need for
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.
Any advice on this would be appreciated.