You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The optimizer will fail if you run a sls function deploy -a from the project root and have multiple function roots in a deeper level. It does not find the inclusion paths.
It seems the plugin does not use the magic handler strategy to find the function root from the function definitions.
If you start the deploy from the function root, it works as expected.
@doapp-ryanp I suggest that the plugin uses SLS Project to get the function root and sets its CWD to there and then executes all the stuff. Then it should work.
The text was updated successfully, but these errors were encountered:
I'm leaving this here to add to the discussion. I think i have identified the problem. I believe the issue is a result of the ternary operator on line 288 of index.js:
If p does not exist fs.lstatSync(p) will fail and exit. This is the case when you have includesPath in your function but are deploying from the sls project root. My attempt to fix the issue was to use a try catch around fs.lstatSync() although I'm not satisfied with that solution.
I just recently came across this issue, the deployment and packaging works when it is ran from the function root but failed when ran from project root.
I've modified the line of code that @hollanddd found to
and that seems to make includePaths work to my expectations (there is no comment as to why the includePath are used rather than the srcPath forthe parameter to lstatSync)
The optimizer will fail if you run a
sls function deploy -a
from the project root and have multiple function roots in a deeper level. It does not find the inclusion paths.It seems the plugin does not use the magic handler strategy to find the function root from the function definitions.
If you start the deploy from the function root, it works as expected.
@doapp-ryanp I suggest that the plugin uses SLS Project to get the function root and sets its CWD to there and then executes all the stuff. Then it should work.
The text was updated successfully, but these errors were encountered: