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

fix(lambda-nodejs): local parcel not detected #10268

Merged
merged 5 commits into from
Sep 21, 2020

Conversation

jogold
Copy link
Contributor

@jogold jogold commented Sep 9, 2020

Fix Parcel detection for non JS/TS CDK projects. For those projects the
module @aws-cdk/aws-lambda-nodejs is not installed in a
node_modules folder inside the project.

Change the detection logic to require.resolve from the project root.

Also in this fix: ensure that the Parcel version that is run inside the
container is the one installed at /. Previously, if an incorrect
version of Parcel was detected bundling would happen in a container as
expected but with the incorrect version because project root is mounted
at /asset-input and in this case it contains the incorrect Parcel
version at /asset-input/node_modules. Again change the
require.resolve paths to avoid this.

Addresses #10123 (not sure yet if it closes it)


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

Fix Parcel detection for non JS/TS CDK projects. For those projects the
module `@aws-cdk/aws-lambda-nodejs` is not installed in a
`node_modules` folder inside the project.

Change the detection logic to `require.resolve` from the project root.

Also in this fix: ensure that the Parcel version that is run inside the
container is the one installed at `/`. Previously, if an incorrect
version of Parcel was detected bundling would happen in a container as
expected but with the incorrect version because project root is mounted
at `/asset-input` and in this case it contains the incorrect Parcel
version at `/asset-input/node_modules`. Again change the
`require.resolve` paths to avoid this.
@jogold jogold changed the title fix(aws-lambda-nodejs): local parcel not detected fix(lambda-nodejs): local parcel not detected Sep 9, 2020
eladb
eladb previously approved these changes Sep 14, 2020
@mergify
Copy link
Contributor

mergify bot commented Sep 14, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@jogold
Copy link
Contributor Author

jogold commented Sep 14, 2020

fixed the conflict

@jogold jogold requested a review from eladb September 14, 2020 19:01
@mergify mergify bot dismissed eladb’s stale review September 14, 2020 19:01

Pull request has been modified.

@jogold
Copy link
Contributor Author

jogold commented Sep 21, 2020

@eladb ?

@mergify
Copy link
Contributor

mergify bot commented Sep 21, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Contributor

mergify bot commented Sep 21, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: a20a3f6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 457fab8 into aws:master Sep 21, 2020
@jogold jogold deleted the lambda-nodejs-parcel-detection branch September 24, 2020 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants