Alexandru-Bogdan Iaru
10/07/2021, 3:16 PM| -- 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!thdxr
10/07/2021, 3:17 PMAlexandru-Bogdan Iaru
10/07/2021, 3:17 PMthdxr
10/07/2021, 3:17 PMthdxr
10/07/2021, 3:17 PMthdxr
10/07/2021, 3:18 PMthdxr
10/07/2021, 3:18 PMAlexandru-Bogdan Iaru
10/07/2021, 3:19 PMAlexandru-Bogdan Iaru
10/07/2021, 3:19 PMthdxr
10/07/2021, 3:20 PMthdxr
10/07/2021, 3:20 PMAlexandru-Bogdan Iaru
10/07/2021, 3:21 PMAlexandru-Bogdan Iaru
10/07/2021, 3:21 PMNoah D
10/07/2021, 8:52 PM..
in that path. I am using a similar sort of structure with
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
August C
11/15/2021, 4:04 PM