Skip to content

Conversation

@BryanCrotazGivEnergy
Copy link

@BryanCrotazGivEnergy BryanCrotazGivEnergy commented Apr 9, 2025

I was having the same issue as #4328.
When building the stack, SST marks all dependencies as external. However monorepo packages haven't been built at this stage, so the TS hasn't been transpiled to JS. Workspace dependencies need to be internal, not external.

This PR filters out packages that are versioned as "workspace:...." when marking dependencies as external when building the stack.

@netlify
Copy link

netlify bot commented Apr 9, 2025

Deploy Preview for sst-docs canceled.

Name Link
🔨 Latest commit e0973e0
🔍 Latest deploy log https://app.netlify.com/sites/sst-docs/deploys/67f64cdd71c6ea00080909bd

@netlify
Copy link

netlify bot commented Apr 9, 2025

Deploy Preview for sst-docs ready!

Name Link
🔨 Latest commit d533dab
🔍 Latest deploy log https://app.netlify.com/sites/sst-docs/deploys/67f655db97fb6a0008d7d141
😎 Deploy Preview https://deploy-preview-68--sst-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@BryanCrotazGivEnergy
Copy link
Author

@fwang I think this is ready for merging if you're happy with it.

@hoangnd25
Copy link
Contributor

@BryanCrotazGivEnergy I think this should be better handled by a different tool like https://turbo.build/ for managing build dependency instead of bake it into SST.

We have our build steps for internal dependencies cached & this would defeat the purpose as they are rebuilt every time.

@BryanCrotazGivEnergy
Copy link
Author

BryanCrotazGivEnergy commented Apr 10, 2025 via email

@hoangnd25
Copy link
Contributor

@BryanCrotazGivEnergy please forgive my ignorance & disregard my comment if I'm wrong here,
but could your problem be solved by separating out stack & handler/lambda dependency so they can be managed separately?

For example:

service-a-iac/package.json

{
  "internal-iac-package": "workspace:*",
   "sst": "*",
   "aws-cdk-lib": "*",
  "service-a-lambda-functions": "workspace:*" // to ensure lambda code to be built before iac code
}

service-a-lambda-functions/package.json

{
  "internal-lambda-package": "workspace:*",
   "sst": "*"
}

@BryanCrotazGivEnergy
Copy link
Author

BryanCrotazGivEnergy commented Apr 11, 2025 via email

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.

2 participants