Cloudflare Pages can't connect Workers

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

hello-world-f04.pages.dev

What is the error number?

404

What is the error message?

“Nothing is here yet”

What is the issue or error you’re encountering

Cloudflare Pages is not routing requests to the worker, resulting in a 404 error.

What steps have you taken to resolve the issue?

Verified that pages_build_output_dir is set to “out” in wrangler.toml.
Verified that output: ‘export’ is set in next.config.js.
Verified that src/app/page.tsx is fetching data from the correct URL.
Verified that out/_worker.js is handling the /kv request correctly.
Deployed the worker to Cloudflare Workers using wrangler deploy.
Deployed the Next.js app to Cloudflare Pages using wrangler pages deploy out.

What are the steps to reproduce the issue?

Create a new Next.js app with a “Hello World” page.
Create a worker that fetches data from KV and displays it on the page.
Configure the wrangler.toml file to deploy the Next.js app to Cloudflare Pages.
Configure the wrangler.toml file to route requests to the worker.
Deploy the Next.js app to Cloudflare Pages.
Deploy the worker to Cloudflare Workers.
Open the app in a browser.