midwayjs / hooks

"Zero" Api / Type Safe / Fullstack Kit / Powerful Backend
MIT License
690 stars 63 forks source link

example的react-faas模板跑不通 #516

Open hechuan9 opened 1 year ago

hechuan9 commented 1 year ago
npx degit https://github.com/midwayjs/hooks/examples/react-faas ./hooks-app
cd hooks-app
pnpm install
pnpm run // 可以跑
npm run deploy // 部署到阿里云

打开网页,报错

{"errorMessage":"Cannot find module '@midwayjs/fc-starter'\nRequire stack:\n- /code/all.js\n- /var/fc/runtime/nodejs16_alinode/prepare_code.js\n- /var/fc/runtime/nodejs16_alinode/invoke.js\n- /var/fc/runtime/nodejs16_alinode/bootstrap.js","errorType":"FunctionUnhandledError: ImportModuleError","stackTrace":["Error: Cannot find module '@midwayjs/fc-starter'","Require stack:","- /code/all.js","- /var/fc/runtime/nodejs16_alinode/prepare_code.js","- /var/fc/runtime/nodejs16_alinode/invoke.js","- /var/fc/runtime/nodejs16_alinode/bootstrap.js","    at Module._resolveFilename (node:internal/modules/cjs/loader:933:15)","    at Module._load (node:internal/modules/cjs/loader:778:27)","    at Module.require (node:internal/modules/cjs/loader:1005:19)","    at require (node:internal/modules/cjs/helpers:102:18)","    at (/code/all.js:2:30)","    at Module._compile (node:internal/modules/cjs/loader:1105:14)","    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)","    at Module.load (node:internal/modules/cjs/loader:981:32)","    at Module._load (node:internal/modules/cjs/loader:822:12)","    at Module.require (node:internal/modules/cjs/loader:1005:19)"]}

把fc-starter换到dependency

pnpm install
npm run deploy

打开网页,返回一大段字符串

PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4...