https://serverless-stack.com/ logo
#help
Title
# help
n

Noah D

10/26/2021, 10:40 AM
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

Frank

10/26/2021, 1:02 PM
Hey @Noah D, did you get it work?
n

Noah D

10/26/2021, 7:28 PM
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

Frank

10/27/2021, 7:36 AM
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

thdxr

10/27/2021, 12:04 PM
I recommend not making infra a workspace
This is the layout I recommend
n

Noah D

10/29/2021, 12:36 AM
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
3 Views