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

TypeError:: Cannot read properties of undefined (reading 'readFile') when resolving projectReferences #1070

Closed
mrgrain opened this issue Jun 11, 2024 · 0 comments · Fixed by #1072
Labels
bug Something isn't working p1

Comments

@mrgrain
Copy link
Contributor

mrgrain commented Jun 11, 2024

When jsii.projectReferences: true, the following error is thrown:

TypeError: Cannot read properties of undefined (reading 'readFile')
    at Compiler.findProjectReferences (/Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/lib/compiler.js:331:86)
    at Compiler.buildTypeScriptConfig (/Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/lib/compiler.js:235:31)
    at Compiler.configureTypeScript (/Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/lib/compiler.js:126:21)
    at new Compiler (/Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/lib/compiler.js:33:30)
    at Object.handler (/Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/lib/main.js:134:26)
    at /Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/node_modules/yargs/build/index.cjs:1:8993
    at j (/Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/node_modules/yargs/build/index.cjs:1:4956)
    at _.handleValidationAndGetResult (/Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/node_modules/yargs/build/index.cjs:1:8962)
    at _.applyMiddlewareAndGetResult (/Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/node_modules/yargs/build/index.cjs:1:9604)
    at _.runCommand (/Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/node_modules/yargs/build/index.cjs:1:7231)
Error: /Users/mrgrain/code/aws/aws-cdk/node_modules/jsii/bin/jsii --silence-warnings=reserved-word --add-deprecation-warnings exited with error code 1
@mrgrain mrgrain added bug Something isn't working p1 labels Jun 11, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 11, 2024
Fixes #1070 

In the compiler constructor, the order of operations was not correct.
This wasn't caught previously because we did not have a test case
covering the automatic project references feature.

---

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

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
aws-cdk-automation pushed a commit that referenced this issue Jun 11, 2024
Fixes #1070

In the compiler constructor, the order of operations was not correct.
This wasn't caught previously because we did not have a test case
covering the automatic project references feature.

---

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

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0

(cherry picked from commit 825d1cb)
aws-cdk-automation pushed a commit that referenced this issue Jun 11, 2024
Fixes #1070

In the compiler constructor, the order of operations was not correct.
This wasn't caught previously because we did not have a test case
covering the automatic project references feature.

---

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

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0

(cherry picked from commit 825d1cb)
aws-cdk-automation pushed a commit that referenced this issue Jun 11, 2024
Fixes #1070

In the compiler constructor, the order of operations was not correct.
This wasn't caught previously because we did not have a test case
covering the automatic project references feature.

---

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

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0

(cherry picked from commit 825d1cb)
mergify bot pushed a commit to aws/aws-cdk that referenced this issue Jun 11, 2024
### Reason for this change

There was an upstream bug in jsii aws/jsii-compiler#1070 that caused the build to fail.
Updating the package manually to confirm the issue is resolved.

### Description of changes

Upgraded to the latest version of jsii that includes a fix for the build issue.

### Description of how you validated changes

Dependency upgrade. Existing tests cover this.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
amazon-codecatalyst bot pushed a commit to pahud/aws-cdk that referenced this issue Jun 12, 2024
### Reason for this change

There was an upstream bug in jsii aws/jsii-compiler#1070 that caused the build to fail.
Updating the package manually to confirm the issue is resolved.

### Description of changes

Upgraded to the latest version of jsii that includes a fix for the build issue.

### Description of how you validated changes

Dependency upgrade. Existing tests cover this.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mazyu36 pushed a commit to mazyu36/aws-cdk that referenced this issue Jun 22, 2024
### Reason for this change

There was an upstream bug in jsii aws/jsii-compiler#1070 that caused the build to fail.
Updating the package manually to confirm the issue is resolved.

### Description of changes

Upgraded to the latest version of jsii that includes a fix for the build issue.

### Description of how you validated changes

Dependency upgrade. Existing tests cover this.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant