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

[aws-lambda-nodejs] NodejsFunction broken on v1.48.0 #8837

Closed
jogold opened this issue Jul 1, 2020 · 10 comments · Fixed by #8838
Closed

[aws-lambda-nodejs] NodejsFunction broken on v1.48.0 #8837

jogold opened this issue Jul 1, 2020 · 10 comments · Fixed by #8838
Assignees
Labels
@aws-cdk/aws-lambda-nodejs bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@jogold
Copy link
Contributor

jogold commented Jul 1, 2020

The NodejsFunction construct is broken on v1.48.0 because it wrongly searches for the closest package.json.

Error Log

@parcel/core: Could not find target with name "cdk-lambda"

Environment

  • CLI Version : 1.48.0
  • Framework Version: 1.48.0
  • Node.js Version: all
  • OS : all
  • Language (Version): all

Other

Already working on a PR with fix.


This is 🐛 Bug Report

@jogold jogold added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 1, 2020
@jogold
Copy link
Contributor Author

jogold commented Jul 1, 2020

@eladb can you pin this issue?

jogold added a commit to jogold/aws-cdk that referenced this issue Jul 1, 2020
The `PackageJsonManager` was always targeting the `package.json` of
`@aws-cdk/aws-lambda-nodejs` and not the one closest to the entry file.

This was not detected in the tests inside the repo because both files
are the same.

Closes aws#8837
@eladb eladb pinned this issue Jul 1, 2020
@mergify mergify bot closed this as completed in #8838 Jul 1, 2020
mergify bot pushed a commit that referenced this issue Jul 1, 2020
The `PackageJsonManager` was always targeting the `package.json` of
`@aws-cdk/aws-lambda-nodejs` and not the one closest to the entry file.

This was not detected in the tests inside the repo because both files
are the same.

Closes #8837


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@tgandrews
Copy link

@jogold when is this likely to be released?

@jogold
Copy link
Contributor Author

jogold commented Jul 2, 2020

@jogold when is this likely to be released?

https://github.com/aws/aws-cdk/releases/tag/v1.49.0

@tgandrews
Copy link

tgandrews commented Jul 2, 2020 via email

@zoonderkins
Copy link

on cdk 1.49.1 version still not working with Nodejs Function parcel error, we have to stick with 1.47.1

Node version: 12 latest on Codebuild
npx: installed 8 in 1.38s
Cannot find project root. Please specify it with `projectRoot`.

@jogold
Copy link
Contributor Author

jogold commented Jul 7, 2020

@ookangzheng can you share your folder structure? Is it a git repository?

@gergan
Copy link

gergan commented Jul 13, 2020

This change likely broke our deployment - it does not take in account monorepos with private packages and lerna, which worked before this change.

@jogold
Copy link
Contributor Author

jogold commented Jul 13, 2020

Hey @gergan, can you open a separate issue for this, detailing your setup?

I'm using the construct in the exact same configuration (a monorepo with private packages and lerna). Would like to see where is the issue for your setup.

@gergan
Copy link

gergan commented Jul 13, 2020

@jogold Thanks for the fast response I have created a new issue and tried to explain our setup, if you need more information I'll be glad to provide it to you.

@shivlaks shivlaks unpinned this issue Jul 29, 2020
@kpeters-cbsi
Copy link

For anyone who comes here from Google like I did - I had this problem because I didn't have a Git repo set up (I was testing something out). When I did git init that fixed the problem. See https://github.com/jogold/aws-cdk/blob/master/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts#L107 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-nodejs bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants