http:
cors: true
path: '{proxy+}'
method: any
environment:
Encrypt_TokenUrl: ${file(./config.json):Encrypt_TokenUrl}
Encrypt_ClientID: ${file(./config.json):Encrypt_ClientID}
Encrypt_ClientSecret: ${file(./config.json):Encrypt_ClientSecret}
Encrypt_GrantType: ${file(./config.json):Encrypt_GrantType}
`
Offline [http for lambda] listening on http://localhost:3002
Function names exposed for local invocation by aws-sdk:
ANY /dev (λ: index)
✖ Unhandled exception in handler 'index'.
✖ Runtime.HandlerNotFound: SERVERLESS_API/serverless-api/dist/index.handler is undefined or not exported
Environment information
Framework Core: 3.34.0 (local)
Plugin: 6.2.3
SDK: 4.3.2
when I use webpack to bundle and build my project. the `sls offline start` not working well.
ANY /dev (λ: index)
✖ Unhandled exception in handler 'index'.
Though debug I fund `_tryRequire` can't load the js file that bundle by webpack
I use webpack build my project. the code as bellow that after build.
`// (() => { // webpackBootstrap // "use strict";
/!! ! ./index.ts ! **/
Object.defineProperty(exports, "__esModule", ({ value: true })); exports.handler = void 0; const lambda_1 = webpack_require(/! ./src/lambda / "./src/lambda.ts"); const handler = function (event, context, callback) { console.log('123123123', lambda_1.handler); (0, lambda_1.handler)(event, context, callback); }; exports.handler = handler;
})();
/**/ })() ; //# sourceMappingURL=index.js.map`
` service: serverless-nestjs custom: serverless-offline: httpPort: 4000
provider: name: aws stage: ${opt:stage, 'dev'} runtime: nodejs16.x region: us-east-1
plugins:
package: exclude:
functions: index: handler: dist/index.handler events:
http: cors: true path: '{proxy+}' method: any environment: Encrypt_TokenUrl: ${file(./config.json):Encrypt_TokenUrl} Encrypt_ClientID: ${file(./config.json):Encrypt_ClientID} Encrypt_ClientSecret: ${file(./config.json):Encrypt_ClientSecret} Encrypt_GrantType: ${file(./config.json):Encrypt_GrantType} ` Offline [http for lambda] listening on http://localhost:3002 Function names exposed for local invocation by aws-sdk:
┌─────────────────────────────────────────────────────────────────────────┐ │ │ │ ANY | http://localhost:4000/dev │ │ POST | http://localhost:4000/2015-03-31/functions/index/invocations │ │ ANY | http://localhost:4000/dev/{proxy*} │ │ POST | http://localhost:4000/2015-03-31/functions/index/invocations │ │ │ └─────────────────────────────────────────────────────────────────────────┘
Server ready: http://localhost:4000 🚀
ANY /dev (λ: index) ✖ Unhandled exception in handler 'index'. ✖ Runtime.HandlerNotFound: SERVERLESS_API/serverless-api/dist/index.handler is undefined or not exported
Environment information