midwayjs / midway-faas

🔱 A simple and lightweight serverless framework
MIT License
389 stars 40 forks source link

function handler = index.handler not found #114

Closed bear-ei closed 4 years ago

bear-ei commented 4 years ago

v 0.2.66

npm test

Testing all *.test.js/ts...

  /test/index.test.ts
    1) invoke

  0 passing (3s)
  1 failing

  1) /test/index.test.ts
       invoke:
     Error: function handler = index.handler not found
      at AsyncFunction.<anonymous> (node_modules/@midwayjs/faas/src/starter.ts:144:13)
      at invokeHandlerWrapper (node_modules/@midwayjs/serverless-fc-starter/src/runtime.ts:55:22)
      at FCRuntime.invokeHandlerWrapper (node_modules/@midwayjs/runtime-engine/src/lightRuntime.ts:19:28)
      [use `--full-trace` to display the full stack trace]
czy88840616 commented 4 years ago

看上去像是因为beta产生了多个ioc容器,我看看包。

czy88840616 commented 4 years ago

看起来没有问题,更新一下依赖,注意先删一下 package-lock.json,防止锁版本。

tsui66 commented 4 years ago

这种错一般是 @midwayjs/faas-cli 和函数版本不一样; 建议检查版本号或 npm install --registry=https://registry.npm.taobao.org @midwayjs/faas-cli -g;