@aws-cdk/aws-lambda-nodejs: bundling fails when adding a workspace or file to nodeModules list #17830
Labels
@aws-cdk/aws-workspaces
Related Amazon WorkSpaces
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
First off, thanks for all the work you all do on CDK, I have so many good things to say about it, it really is the future of IaC ❤️
This might be an edge case, but I really want to get aws-lambda-nodejs working for us, when it is it'll make our cdk setup super sleak!
I'll figure out a workaround and update the issue when I do, and hopefully be able to actually contribute towards a solution.
What is the problem?
We have a monorepo setup with all our packages in a packages directory.
When I have a dependency listed in the
nodeModules
attribute ofbundling
which is in our workspaceThe generated package.json looks like this:
and the
yarn install --no-immutable
which runs in the bundling-temp directory fails with:When I try to use the same package with file instead of workspace the generated package.json looks like this:
and the
yarn install --no-immutable
which runs in the bundling-temp directory fails with:It works fine when using normal packages from the registry.
Reproduction Steps
I've created a stripped-down monorepo which reproduces this. It's a bit big because of the .yarn/cache folder, sorry.
What did you expect to happen?
The workspace/file packages referenced in my package.json should be installed correctly for my bundled code.
What actually happened?
It errored, as above.
CDK CLI Version
1.134.0
Framework Version
No response
Node.js Version
v14.18.1
OS
macOS Monterey 12.0.1
Language
Typescript
Language Version
4.3.5
Other information
full stack trace:
The text was updated successfully, but these errors were encountered: