`_redirects` wouldn't work because the worker takes priority over the redirects in that file
_redirects wouldn't work because the worker takes priority over the redirects in that file_redirectsnext-dev package). Turns out I was calling a server action from a page where I forgot to set the runtime to "edge"...export const runtime = 'edge' // 'nodejs' (default) | 'edge' inside of my app/layout.tsx file so everything is edge (unless I've misunderstood the issue you are facing)
name: Deploy Production
on:
push:
branches:
- master
jobs:
deploy:
runs-on: pages-build
name: Deploy
steps:
- uses: actions/checkout@v3
- name: Build
shell: bash
run: npm ci && npm run pages:build
env:
NODE_OPTIONS: ${{ vars.NODE_OPTIONS }}
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy .vercel/output/static --project-name=PROJECT_NAME_HEREnext-devexport const runtime = 'edge' // 'nodejs' (default) | 'edge'app/layout.tsx durableObjects: {
name: "CLOUDFLARE_DO",
className: "Counter",
// scriptName: "cloudflare-do",
},Warning:
You have requested Durable Objects but no local instance of such has been found.
In order to access your Durable Objects please start the relevant workers locally
with `wrangler dev` and then restart the next dev server.
The following bindings won't be accessible until then:
- name
- className[[durable_objects.bindings]]
name = "CLOUDFLARE_DO"
class_name = "Counter"const DurableObjectPage = async ({}: DurableObjectPageProps) => {
console.log(process.env.CLOUDFLARE_DO);
const res = await process.env.CLOUDFLARE_DO.fetch();
console.log({ res });
return (
<>
<h1>Durable Object</h1>
{res}
</>
);
};
export default DurableObjectPage;12:12:23.387 Detected the following tools from environment: npm@9.6.7, nodejs@18.17.1
12:12:23.388 Installing project dependencies: npm clean-install --progress=false
12:12:27.033 npm ERR! code ERESOLVE
12:12:27.042 npm ERR! ERESOLVE could not resolve
12:12:27.042 npm ERR!
12:12:27.043 npm ERR! While resolving: @material-ui/core@4.12.4
12:12:27.043 npm ERR! Found: @types/react@18.2.45
12:12:27.043 npm ERR! node_modules/@types/react
12:12:27.043 npm ERR! dev @types/react@"^18" from the root project
12:12:27.043 npm ERR! peerOptional @types/react@"*" from @material-ui/types@5.1.0
12:12:27.044 npm ERR! node_modules/@material-ui/types