Hi and thanks for the awesome project! :raised_han...
# help
a
Hi and thanks for the awesome project! 🙌 I got into a problem. My infrastructure folder & actual code folder are at the same level. Kind of like:
Copy code
| -- infrastructure | -- src
|                   | -- package.json
|
| -- service ------ | -- src ------------- | -- functions -- | -- createProfileHandler.ts
|                   | -- package.json
When I try to build(current directory = infrastructure) , assets are built in the correct folder, but I get the "`Cannot find asset : somePath/service/src/functions/.build/---main-src-functions-createProfileHandler-handler-1633618636177`" error The function handler in the API props is "../service/src/functions/createProfileHandler.handler" I think the asset lookup is not looking for the right file because of the ".." in the path which is transformed to "--" in the asset filename. The strange thing is that sst start is deploying successfully and the error is encountered on sst build & sst deploy Can you give me some help on how to reference handlers from an outside folder(outside from infrastructure/lib folder)? I tried using: 1. srcPath & handler props 2. srcPath using setDefaultFunctionProps 3. only handler prop 4. with
__dirname__
Thanks!
t
Where is your sst.json file?
a
in the infrastructure folder
t
Right now sst doesn't work with that structure
sst.json needs to be in the root and commands run from there
I recommend this structure
a
ok, thanks!
do you think you can support the separate folders structure in the future?
t
I do want to fix how we deal with paths across the system which would allow for this
taking some small steps to that this week
a
great! i will stay tuned to the updates
thanks
n
Hey @Alexandru-Bogdan Iaru if you still are using the previous structure, i think your problem might be the
..
in that path. I am using a similar sort of structure with
Copy code
infra 
  | ...
src 
  | ...
and my reference to lambdas in infra looks like
src/services/SOME_SERVICE/FILE_NAME.main
so for you i suspect it might look like
service/src/functions/createProfileHandler.handler
a
i also would second supporting seperate folder structures in the future! my setup is i have a monorepo with packages that don't necessarily use sst so it's odd having sst and lambdas being defined in the root directory