Pages Functions 'Advanced Mode' setup problems

For Workers & Pages, what is the name of the domain?

example.com

What is the issue or error you’re encountering

After adding _worker.js as the docs mention, the ‘Advanced Mode’ does not apply

What are the steps to reproduce the issue?

I am trying to have all functions accessed at /api/function instead of /function

Here:

It says that by adding _worker.js at the ‘output directory’, it will be applied. I tried both the example script on that page and a custom one and neither applied the ‘advanced mode’
Alos tried renaming functions folder to gibberish and still it did not apply

So i am asking for your help, wondering if i am placing it in the wrong location or if there is some setting to enabled

Thanks in advance

`

Screenshot of the error

If your build output is in ./dist/ or ./build/, the _worker.js file should be inside this folder.

The name is correct _worker.js as it should be from what I see from your attached screenshot.

Is your structure as example from below or something similar, or different?:

/project-root
├── /dist        # Output directory after build (e.g., after running npm run build)
│   ├── index.html
│   ├── /assets
│   ├── _worker.js   # Your Worker script here
├── wrangler.toml
└── /src

Since you’ve mentioned Advanced Mode, may I ask if you’re using Workers KV or Durable objects in such case or not?

Otherwise, wrangler.toml is present and configured correctly?

Have you tried using the debug and checking the log ouput?