Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm_requirements does not work correctly #506

Closed
phildier opened this issue Oct 20, 2023 · 3 comments · May be fixed by #621
Closed

npm_requirements does not work correctly #506

phildier opened this issue Oct 20, 2023 · 3 comments · May be fixed by #621

Comments

@phildier
Copy link

phildier commented Oct 20, 2023

Description

When using npm_requirements to automatically run npm install during package build, this parameter is ignored. If you have already run npm install in the source directory the zip task will happily include node_modules, but in a new project or CI/CD nothing happens. This is due to the actual reference to the claim parameter in package.py pointing to npm_package_json instead of npm_requirements. When updating the claim to use npm_package_json it works correctly. However the documentation doesn't match this requirement. From this PR #293 it appears that the developer intended to use npm_requirements but forgot to change the claim reference in package.py before committing.

Reproduction Code [Required]

  source_path = [
    {
      path             = "${path.module}/collect_queue_metrics/",
      npm_requirements = true,
    }
  ]

Start with a new nodejs lambda project that uses a package.json to install dependencies which aren't included by default by the lambda runtime. terraform apply and note that npm install does not run. Change the above npm_requirements to npm_package_json and note that npm install does in fact run.

Expected behavior

Expect npm install to run when using the claim property described in the documentation.

Actual behavior

npm install does not run when using the claim property described in the documentation.

Additional Context

  1. feat: Add support to build automatically npm dependencies #293
  2. https://github.com/terraform-aws-modules/terraform-aws-lambda/blob/master/package.py#L794
Copy link

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label Nov 20, 2023
Copy link

github-actions bot commented Dec 1, 2023

This issue was automatically closed because of stale in 10 days

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2023
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant