AnomalyInnovations/serverless-bundle

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.

  1. generate new service: serverless install --url https://github.com/AnomalyInnovations/serverless-typescript-starter --name [your-service]
  2. cd [your-service]
  3. npm i
  4. fix broken test in starter (or remove)
  5. confirm service packages: sls package --stage=dev
  6. upgrade serverless-bundle: npm i --save-dev serverless-bundle@latest
  7. change the service name in serverless.yml
  8. 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