You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using TypeScript and serverless-webpack, and it might be an issue related to serverless-webpack since I've seen a lot of similar issues (they are closed though and should be fixed).
By the time my code hits this it has correctly pulled the handlerPath from serverless.yml, so when trying to run the custom authorizer it's looking for /path/to/directory/server/server. If I modify this path during execution to /path/to/directory/server/server.ts it can at least resolve the path, but it hits another error because of the es6 style imports in my server.ts. I imagine that it should really be trying to resolve the server.js that is built by webpack and put in /path/to/directory/.webpack/service/server/server.js
thank you for filing the issue. I kind of got your setup running, but with some modifications. the handler file is also missing. Could you create a small repository which I can check out?
Hey @dnalborczyk I started with the aws-nodejs-typescript starter here: https://serverless.com/framework/docs/providers/aws/cli-reference/create/ and incrementally added things in to get close to my previous set up and everything is working. I realized it's probably not specific to servervless-offline and most likely serverless-webpack because the same issue occurs when I actually deploy with Serverless.
At some point I'll try to keep adding configurations to my setup until I identify what actually caused the issue. I'll post back here once I do, but it may be a while
I'm using TypeScript and serverless-webpack, and it might be an issue related to serverless-webpack since I've seen a lot of similar issues (they are closed though and should be fixed).
I ran
serverless offline
in debug mode and traced the issue to this line: https://github.com/dherault/serverless-offline/blob/master/src/lambda/handler-runner/InProcessRunner.js#L22.By the time my code hits this it has correctly pulled the
handlerPath
fromserverless.yml
, so when trying to run the custom authorizer it's looking for/path/to/directory/server/server
. If I modify this path during execution to/path/to/directory/server/server.ts
it can at least resolve the path, but it hits another error because of the es6 style imports in myserver.ts
. I imagine that it should really be trying to resolve theserver.js
that is built by webpack and put in/path/to/directory/.webpack/service/server/server.js
I'm new to serverless, but not to webpack or typescript and I've been googling and tampering with the configuration for the past 8 hours. I found some potentially related issues:
serverless-heaven/serverless-webpack#505
serverless-heaven/serverless-webpack#383
serverless-heaven/serverless-webpack#43
serverless-heaven/serverless-webpack#230
Happy to help provide any more information or assist with the debugging process!
Version:
6.x alpha release
serverless.yml
webpack.config.js
package.json
tsconfig.
The text was updated successfully, but these errors were encountered: