Hey there currently trying to get a decently simpl...
# help
n
Hey there currently trying to get a decently simple infra setup working with ts mono/yarn workspaces The problem I am facing is when i try to run
sst start
it seems unable to deploy my stack giving me the error
Error: Cannot find asset at C:\users\noah\documents\code\.build\dist\stub.zip
I am only trying to launch a lambda function with minimal functionality (screenshot 1&2) I will note I have only just started learning about yarn workspaces (and trying to use yarn 3) so might be some misconfiguration there. But any thoughts around potential paths to debug would be helpful too 👌🏼
My workspaces are follows
Copy code
"workspaces": [
    "src/core/*",
    "src/services/*",
    "infra"
  ],
Where
infra
holds any sst stacks
src/core
holds any shared code - i.e. there may be a package
src/core/sample
which has it's own package.json, dependencies etc and
src/services
holds lambda handlers
Ok actually stumbled onto the solution for this, it seems I was installing the package
@serverless-stack/resources
in the infra package, when It should have been installed in the root of the project
f
Hey @Noah D, did you get it work?
n
Hey Frank yes I did, think asking the question helped find the answer as it sometimes does 😅. Something I am curious about is that I had to add
@serverless-stack/resources
as a dependency at the root of my project to fix the issue, but also had to add it as a dependency within my infrastructure workspace or eslint will give me a
no-extraneous-dependencies
error. I was wondering if you know if this is an alright thing to do in the longterm? Or if I shouldn't be installing it in two places sorta deal? 🤔
f
hmm.. I think you shouldn’t add dependencies to the root. But let me pull in @thdxr as he’s quite knowledgable on this.
t
I recommend not making infra a workspace
This is the layout I recommend
n
Thanks for that @thdxr I originally started with the mono starter. Then tried to make infra a workspace, but came to the same conclusion where making it a workspace kinda screws with a bunch of config. Resorted back to only workspacing packages etc