the example can't run,what happened?
banditsmile opened this issue ยท comments
Question
the example can't run,what happened?
Firstly, I want to deploy my own code to vercel,but there are always runtime error when building the code.
[21:19:18.785] Running build in Washington, D.C., USA (East) โ iad1
[21:19:18.920] Cloning github.com/banditsmile/meta (Branch: main, Commit: 92dae1f)
[21:19:19.161] Cloning completed: 240.269ms
[21:19:19.248] Previous build cache not available
[21:19:19.455] Running "vercel build"
[21:19:19.968] Vercel CLI 33.6.1
[21:19:20.129] > Installing Builder: vercel-php@0.3.5
[21:19:22.321] ๐ Downloading user files
[21:19:22.322] ๐ Downloading PHP runtime files
[21:19:22.337] ๐ Creating lambda
[21:19:22.345] Build Completed in /vercel/output [25ms]
[21:19:22.460] Deploying outputs...
[21:19:22.468] Error: The following Serverless Functions contain an invalid "runtime":
[21:19:22.468] - api/index (nodejs18.x). Learn More: https://vercel.com/guides/serverless-function-contains-invalid-runtime-error
[21:19:22.543]
I've checked this "https://vercel.com/guides/serverless-function-contains-invalid-runtime-error", the problem seems to be lasted to 2025?
Then, I turned to try example code
% cd test/examples
% cd 00-php
% vercel
Vercel CLI 33.6.1
? Set up and deploy โ~/Projects/codes/github.com/vercel-community/php/test/examples/00-phpโ? [Y/n] y
? Which scope do you want to deploy to? banditsmile's projects
? Link to existing project? [y/N] n
? Whatโs your projectโs name? 00-php
? In which directory is your code located? ./
Local settings detected in vercel.json:
No framework detected. Default Project Settings:
- Build Command: `npm run vercel-build` or `npm run build`
- Development Command: None
- Install Command: `yarn install`, `pnpm install`, `npm install`, or `bun install`
- Output Directory: `public` if it exists, or `.`
? Want to modify these settings? [y/N] n
๐ Linked to banditsmiles-projects/00-php (created .vercel)
๐ Inspect: https://vercel.com/banditsmiles-projects/00-php/FJJVENUXVwJ9nNFL7zBysVZcUyTj [4s]
โ
Production: https://00-r7u9dmydn-banditsmiles-projects.vercel.app [4s]
Error: The following Serverless Functions contain an invalid "runtime":
- api/api/index (nodejs18.x)
- api/api/users (nodejs18.x)
- api/ext/ds (nodejs18.x)
- api/ext/gd (nodejs18.x)
- api/ext/index (nodejs18.x)
- api/ext/phalcon (nodejs18.x)
- api/hello (nodejs18.x)
- api/index (nodejs18.x)
- api/ini/index (nodejs18.x)
- api/libs (nodejs18.x)
- api/test (nodejs18.x)
It seems that the example code can't run too.
Does this means this project will been gaven up?
Do as this => qkqpttgf/OneManager-php#722
๐ Since this project manually enforces the runtime to be nodejs18.x
, you have to make sure your project's Node.js version is the same (Settings > Node.js Version > Select 18.x)
Line 126 in 5cefd55
this works for me ,thank you
New version 0.7.1 released.