https://serverless-stack.com/ logo
#sst
Title
# sst
e

Erik Robertson

09/29/2021, 3:04 PM
Newbie needs help.... I have simply followed instructions to install the rest-api example using
npx create-serverless-stack@latest --example rest-api sst-test2
and then cd and do npm run start it deploys the debug stack and then fails beore deploying the app stack saying:
Cannot find app handler. Make sure to add a "lib/index.js" file.
There is indeed no such file in the sample. There is a stacks folder instead which is being referred to in sst.json. Is /lib' a hardcoded dependency??
r

Ross Coundon

09/29/2021, 3:05 PM
There's a property in sst.json called main where you can specify where your stacks live. Might be a legacy bug in the starter example from when that folder was called lib
e

Erik Robertson

09/29/2021, 3:06 PM
And what's really odd is that I did the same thing a few days ago and it worked ok
My sst.json does indeed contain
"main": "stacks/index.js"
no reference to lib whatsoever
r

Ross Coundon

09/29/2021, 3:20 PM
Curious, one for @Frank or @thdxr
e

Erik Robertson

09/29/2021, 3:23 PM
Thanks for the quick reaction @Ross Coundon, I guess it should be super simple to reproduce and make sure it's not an environmental artifact on my end.
t

thdxr

09/29/2021, 3:25 PM
I'll take a look in a few min
this might be an issue on our side because we did some bulk renaming and might have missed something
ah the issue is the version of sst referenced in the templates in package.json is extremely old
if you update @serverless-stack/cli and @serverelss-stack/resources it should work. We need to fix this thanks for finding the issue
e

Erik Robertson

09/29/2021, 3:45 PM
Thanks, that did it !
s

Seth Geoghegan

10/18/2021, 1:30 PM
just ran up against this issue as well
f

Frank

10/19/2021, 4:17 PM
Hey @Seth Geoghegan did updating cli and resources solve it for u?
s

Seth Geoghegan

10/19/2021, 4:19 PM
It did!
Sorry, I should have added that 🙂
f

Frank

10/19/2021, 4:20 PM
Just wanted to make sure of that 👍