sst / console

A web based dashboard for your SST apps
https://console.sst.dev
247 stars 23 forks source link

Autodeploy not working as expected in a monorepo #20

Closed dhoulker closed 2 months ago

dhoulker commented 4 months ago

We have been using Autodeploy on our project.

We have a Turborepo monorepo, and we import some shared config from a local package in our sst.config.ts

With this approach the Autodeploy service is not able to read our sst config and the deploy fails, we see Error evaluating sst.config.ts

CleanShot 2024-07-25 at 06 53 28@2x

Once we replace the shared config with actual values the deploy works great.

Let me know if you need a reproducible example, or if i've raised this in the right place.

jayair commented 4 months ago

Yeah can you share what you've added to your sst config? We try and strip the imports but what's happening is that it's trying to eval it in an environment that doesn't have these dependencies. This gets done before the actual build is run.

dhoulker commented 4 months ago

Here's repo for you - https://github.com/dhoulker/sst-monorepo-sandbox

Local deploy works irrespective of how the region is set.

Let me know if you need anything else, dev branch is the one you need above.

You can see my attempts below

CleanShot 2024-07-29 at 13 15 38@2x

Thanks!

jayair commented 3 months ago

Yeah I don't think this'll quite work. Because of what I was mentioning above. I know you said it's a contrived example but in your real use case is it the region that you are setting through an import?

dhoulker commented 3 months ago

Our use case is that we have multiple sst projects in the repo and would to share some config, eg stage name.

Its not a huge problem, if this is a limitation i'm sure we can work round it.