Kent👋
Kent👋
CDCloudflare Developers
Created by Kent👋 on 11/3/2023 in #pages-help
Cloudflare Pages: NextJS&VueJS Hybrid deployment failed
Hi, I am using NextJS functions and VueJS static files for a historical problem. My project arch is: src/pages/api/*.js for functions and fe/*.vue . My Pages framework is selected as NextJS. Before each build, I will use npm run prebuild to change directory to fe and build the static files to public.
{
"prebuild": "cd fe && npm install && npm run build",
"build": "next build",
}
{
"prebuild": "cd fe && npm install && npm run build",
"build": "next build",
}
But I found vite cannot be found in cloudflare pages' build phase. (More detailed log is attached)
12:12:35.773 â–² config [`cacache`](http://npm.im/cacache).
12:12:35.791 â–² > [email protected] build
12:12:35.791 â–² > rm -rf ../public && vite build
12:12:35.814 â–² sh: 1: vite: not found
12:12:35.841 â–² Error: Command "npm run build" exited with 127
12:12:35.773 â–² config [`cacache`](http://npm.im/cacache).
12:12:35.791 â–² > [email protected] build
12:12:35.791 â–² > rm -rf ../public && vite build
12:12:35.814 â–² sh: 1: vite: not found
12:12:35.841 â–² Error: Command "npm run build" exited with 127
I think vite should be installed by npm run install but unfortunately not. Thanks for your help. More info, if I build the fe locally, everything works fine. So the hybridzation deployment is technically possible.
3 replies
CDCloudflare Developers
Created by Kent👋 on 7/26/2023 in #workers-help
â–² error - Provided runtime "edge" is not supported.
Hi, I am creating a project with NextJs,in which there are some page functions under /pages/api/xxx.ts. I have read the docs from NextJs' site to adapt my code to cf pages env by adding the code below
export const config = { runtime: 'edge' };
export const config = { runtime: 'edge' };
or
export const runtime = 'edge';
export const runtime = 'edge';
But I got the following error.
17:35:16.870 â–² info - Creating an optimized production build...
17:35:16.926 â–² error - Provided runtime "edge" is not supported. Please leave it empty or choose one of: experimental-edge, nodejs
17:35:16.940 ▲ ELIFECYCLE  Command failed with exit code 1.
17:35:17.008 â–² Error: Command "pnpm run build" exited with 1
17:35:17.117 ▲ ERROR  Command failed with exit code 1: vercel build
17:35:17.117 â–²
17:35:17.117 â–² pnpm: Command failed with exit code 1: vercel build
17:35:17.118 â–² at makeError (/opt/buildhome/.cache/node/corepack/pnpm/8.2.0/dist/pnpm.cjs:24230:17)
17:35:17.118 â–² at handlePromise (/opt/buildhome/.cache/node/corepack/pnpm/8.2.0/dist/pnpm.cjs:24801:33)
17:35:17.118 â–² at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
17:35:17.118 â–² at async Object.handler [as dlx] (/opt/buildhome/.cache/node/corepack/pnpm/8.2.0/dist/pnpm.cjs:206486:7)
17:35:17.118 â–² at async /opt/buildhome/.cache/node/corepack/pnpm/8.2.0/dist/pnpm.cjs:215818:21
17:35:16.870 â–² info - Creating an optimized production build...
17:35:16.926 â–² error - Provided runtime "edge" is not supported. Please leave it empty or choose one of: experimental-edge, nodejs
17:35:16.940 ▲ ELIFECYCLE  Command failed with exit code 1.
17:35:17.008 â–² Error: Command "pnpm run build" exited with 1
17:35:17.117 ▲ ERROR  Command failed with exit code 1: vercel build
17:35:17.117 â–²
17:35:17.117 â–² pnpm: Command failed with exit code 1: vercel build
17:35:17.118 â–² at makeError (/opt/buildhome/.cache/node/corepack/pnpm/8.2.0/dist/pnpm.cjs:24230:17)
17:35:17.118 â–² at handlePromise (/opt/buildhome/.cache/node/corepack/pnpm/8.2.0/dist/pnpm.cjs:24801:33)
17:35:17.118 â–² at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
17:35:17.118 â–² at async Object.handler [as dlx] (/opt/buildhome/.cache/node/corepack/pnpm/8.2.0/dist/pnpm.cjs:206486:7)
17:35:17.118 â–² at async /opt/buildhome/.cache/node/corepack/pnpm/8.2.0/dist/pnpm.cjs:215818:21
I don't know why, thanks for your help.
12 replies
CDCloudflare Developers
Created by Kent👋 on 7/3/2023 in #pages-help
A 500 error without exception log stream
1 replies
CDCloudflare Developers
Created by Kent👋 on 7/3/2023 in #pages-help
nextjs
8 replies