Open svetlasyrimis opened 2 years ago
Het @svetlasyrimis, thanks for raising it. Does it work in the deployed environment? Could you also try set all nestjs packages as external
Thanks for your prompt reply, will try that.
Using custom esbuild script to deploy, not sls.
I used @anatine/esbuild-decorators
plugin as this example here: https://docs.serverless-stack.com/constructs/Function, and it solved the problem.
Thank you @vinicius91carvalho , will try that. So far still not working.
Update: Using esbuild-plugin-ts-decorators
and plugins option in serverless.yaml actually made it work. Thanks for the help @vinicius91carvalho :)
Update: Using
esbuild-plugin-ts-decorators
and plugins option in serverless.yaml actually made it work. Thanks for the help @vinicius91carvalho :)
@svetlasyrimis Am i missing something? how do you use esbuild-plugin-ts-decorators in the serverless.ts file
This is what she meant by
serverless.yml
esbuild:
plugins: esbuild-plugins.js
bundle: true
minify: true
sourcemap: true
external:
- 'class-transformer'
- 'class-validator'
- '@nestjs/microservices'
- '@nestjs/websockets/socket-module'
- 'cache-manager'
- 'fastify-swagger'
esbuild-plugins.js
/* eslint-disable @typescript-eslint/no-var-requires */
const { esbuildDecorators } = require('esbuild-plugin-typescript-decorators');
module.exports = () => {
return [esbuildDecorators()];
};
Hello,
I've encountered that weirdly dependency injection breaks(Nest.js project) when attempting to use
serverless-esbuild
in local environment. However when attempting to useserverless-webpack
it's all working fine.serverless-offline@8.3.1 serverless-esbuild@1.23.3 serverless@2.72.2 serverless-webpack@5.6.0