Open pratik-github opened 6 months ago
HI @pratik-github you can try the following add libraryTarget:"commonjs2"
to the webpack.config.js
and remove webpack config from serverless.yml and also update function handler in serverless to the following handler: ./dist/src/main.handler
@pratik-github final three file changes I made
Once completed run npx nx run graphql:build && npx nx run graphql:offline
thanks @jameelio , I'll try these options and let you know
Thanks a lot, I had the same issue and adding libraryTarget:"commonjs2"
worked for me 🙏
Current Behavior
I am trying to setup serverless api using stack: nx 18 + nest + webpack + serverless node: 20.x
gives error:
Expected Behavior
API should work
GitHub Repo
https://github.com/pratik-github/demo-nx-nest-serverless
Steps to Reproduce
Internal server error
Nx Report
Failure Logs
Package Manager Version
10.1.0
Operating System
Additional Information
verified by deploying to aws lambda
reference:
initial setup was done via `npx create-nx-workspace demoapp --preset=nest --bundler=webpack