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-cdk-lib: Version >=2.99.1 Cannot find module './aspect' #27469

Closed
WtfJoke opened this issue Oct 9, 2023 · 7 comments
Closed

aws-cdk-lib: Version >=2.99.1 Cannot find module './aspect' #27469

WtfJoke opened this issue Oct 9, 2023 · 7 comments
Assignees
Labels
aws-cdk-lib Related to the aws-cdk-lib package bug This issue is a bug. needs-reproduction This issue needs reproduction.

Comments

@WtfJoke
Copy link
Contributor

WtfJoke commented Oct 9, 2023

Describe the bug

For some unknown reason with cdk version >=2.99.1 I always get an error on any cdk command.
For example if I run yarn cdk synth synth I get an error.
When I run the same command on cdk version 2.99.0 everything works as expected.

However, this is only reproducable on one of my two machines.

Expected Behavior

I expect any cdk command succeed in this example I expect following output:

yarn cdk synth 
yarn run v1.22.19
warning ../../../package.json: No license field
$ cdk synth

This app contains no stacks

Current Behavior

When I run yarn cdk synth I get following error:

yarn run v1.22.19
warning ../../../package.json: No license field
$ cdk synth
Error: Cannot find module './aspect'
Require stack:
- /home/manuel/dev/git/cdk-bug-2.99.1/node_modules/aws-cdk-lib/core/lib/index.js
- /home/manuel/dev/git/cdk-bug-2.99.1/node_modules/aws-cdk-lib/core/index.js
- /home/manuel/dev/git/cdk-bug-2.99.1/node_modules/aws-cdk-lib/lazy-index.js
- /home/manuel/dev/git/cdk-bug-2.99.1/bin/CarbonAwareServerlessJobs.ts
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename]
 (/home/manuel/dev/git/cdk-bug-2.99.1/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at Function.Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/home/manuel/dev/git/cdk-bug-2.99.1/node_modules/aws-cdk-lib/core/lib/index.js:1:622)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Object.require.extensions.<computed> [as .js] (/home/manuel/dev/git/cdk-bug-2.99.1/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1119:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/manuel/dev/git/cdk-bug-2.99.1/node_modules/aws-cdk-lib/core/lib/index.js',
    '/home/manuel/dev/git/cdk-bug-2.99.1/node_modules/aws-cdk-lib/core/index.js',
    '/home/manuel/dev/git/cdk-bug-2.99.1/node_modules/aws-cdk-lib/lazy-index.js',
    '/home/manuel/dev/git/cdk-bug-2.99.1/bin/CarbonAwareServerlessJobs.ts'
  ]
}

Subprocess exited with error 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproduction Steps

  1. Clone https://github.com/WtfJoke/cdk-bug-2.99.1
  2. yarn install
  3. yarn cdk synth
  4. Error (but only on my machine 😢 )

Possible Solution

No response

Additional Information/Context

I really dont know why this happens only on this one machine and how it differs with the other.
I made a fresh git clone + install of the reproducer.

Also if I switch to branch cdk-2.99.0 where I only downgraded aws-cdk-lib and aws-cdk, everything works again.

CDK CLI Version

2.99.1

Framework Version

No response

Node.js Version

v18.18.0

OS

windows 11 (0.0.22621 Build 22621) on wsl 1.2.5.0

Language

TypeScript

Language Version

5.2.2

Other information

Release 2.99.1 contains only one bug fix change (see https://github.com/aws/aws-cdk/releases/tag/v2.99.1) so it needs to be related with PR #27314, which only changed 3 files.

@WtfJoke WtfJoke added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 9, 2023
@github-actions github-actions bot added the aws-cdk-lib Related to the aws-cdk-lib package label Oct 9, 2023
@indrora
Copy link
Contributor

indrora commented Oct 9, 2023

I'm unable to reproduce this under macos 13/yarn 1.22.18/cdk 2.99.1

@khushail khushail added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 9, 2023
@WtfJoke
Copy link
Contributor Author

WtfJoke commented Oct 9, 2023

@indrora @khushail

Since the issue got the label "response requested".... Can you give me some guidance what I should provide as additional context/information?
As I've written for some reason this affects only one machine.

@peterwoodworth
Copy link
Contributor

@indrora could you please attempt a reproduction on wsl?

@peterwoodworth peterwoodworth added needs-reproduction This issue needs reproduction. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. needs-triage This issue or PR still needs to be triaged. labels Oct 9, 2023
@indrora
Copy link
Contributor

indrora commented Oct 10, 2023

I can't replicate on WSL.

@indrora
Copy link
Contributor

indrora commented Oct 10, 2023

@kellertk can you replicate this?

@WtfJoke
Copy link
Contributor Author

WtfJoke commented Oct 11, 2023

Thank you very much for your assist @indrora @peterwoodworth!

A colleague of mine suggested to execute yarn cache clean.
After that I wiped node_modules again (I tried wiping that before, but that didnt helped) and made another yarn install and now everything works as expected.

Appreciate your help!

@WtfJoke WtfJoke closed this as completed Oct 11, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-cdk-lib Related to the aws-cdk-lib package bug This issue is a bug. needs-reproduction This issue needs reproduction.
Projects
None yet
Development

No branches or pull requests

4 participants