Error when packaging service: Unable to find Webpack configuration - bundle version 5.3.0
jonathanbravecredit opened this issue · 3 comments
Issue
Unable to package services using version 5.3.0 when changing the service name. Results in an error Unable to find Webpack configuration
This appears to be a regression because in earlier versions of the serverless-bundle, namely v3.2.1 which comes with the typescript-starter, this does not happen.
EDIT
I am now experiencing this issue intermittently and not sure if renaming the service is the root cause, but in my case it was reproducible following these steps.
Steps to reproduce
I use the typescript starter repo to initiate new services and then i upgrade them to the latest bundle before building.
- generate new service:
serverless install --url https://github.com/AnomalyInnovations/serverless-typescript-starter --name [your-service]
cd [your-service]
npm i
- fix broken test in starter (or remove)
- confirm service packages:
sls package --stage=dev
- upgrade serverless-bundle:
npm i --save-dev serverless-bundle@latest
- change the service name in serverless.yml
- try to package up service again:
sls package --stage=dev
Additional info
Even when enabling SLS_DEBUG there is not a lot of information to go off of but will paste what I have in case it helps. I also can confirmed in the serverless-bundle module folder the webpack config file is present.
Exception -----------------------------------------------
'Unable to find Webpack configuration'
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 14.15.1
Framework Version: 2.31.0
Plugin Version: 4.5.2
SDK Version: 4.2.2
Components Version: 3.7.7```
I believe I have isolated the issue, and that being that I did not have any lambda functions generated. I was slowly building out my services in this case, ensuring I spun up only the resources first and then moving to my lambda functions. I guess I had always just had at least one lambda before this. A better error message would have helped in this case.
In my case, not having any lambda function was causing this error. I added a dummy one and it worked.
Adding a dummy lambda also worked for me, really odd but thank god for this post. This was just my dynamo table and all my other packages were dependencies with actual functions