Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

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

Open
hechuan9 opened this issue Jan 25, 2023 · 0 comments
Open

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

hechuan9 opened this issue Jan 25, 2023 · 0 comments
Assignees

Comments

@hechuan9
Copy link

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...
@Lxxyx Lxxyx self-assigned this Jan 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants