serverless-webpack icon indicating copy to clipboard operation
serverless-webpack copied to clipboard

Webpack generating wrong symlink to package.json and node_modules on build

Open rafapaulin opened this issue 2 years ago • 1 comments

This is a Bug Report

Description

For bug reports:

  • What went wrong? Webpack is generating node_modules and package.json symlinks on build folder that points to wrong location, breaking all the modules imports on lambdas.
  • What did you expect should have happened? symlink created correctly
  • What was the config you used? image image
  • What stacktrace or error message from your provider did you see? image image these symlinks should be valid. (point to /home/rafapaulin/lab/Valtech/elastic-platform/{node_modules|package.json})

same error on aws cloudwatch image

For feature proposals:

  • What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us. N/A
  • If there is additional config how would it look N/A

Similar or dependent issue(s): N/A

Additional Data

  • Serverless-Webpack Version you're using: 5.9.1
  • Webpack version you're using: 5.74.0
  • Serverless Framework Version you're using: 3.19.0
  • Operating System: linux
  • Stack Trace (if available):

This happens on both deploying and running lambdas locally

rafapaulin avatar Aug 31 '22 03:08 rafapaulin

@rafapaulin Hi, thanks for reporting. I don't think I understand the issue, because if it's only an incorrect symlink the required module should not be 'undefined' and ''.

Would you mind sharing a more detailed reproducing steps or a minimum reproducing repo?

vicary avatar Sep 06 '22 18:09 vicary