-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Hi there!
It seems like this plugin when used with serverless-offline executes some Serverless lifecycle hooks twice. Specifically, this line. I am not familiar with that method, but I think it is the programmatic equivalent of doing sls export-env, which will (re)execute all hooks.
I came across this issue because I also use lift. When executing sls offline start, I get an error that is thrown here, which probably indicates that the initialize hook is executed twice.
If I comment this line, the problem goes away.
I think that initOfflineHook() should probably call the internal functions (["collect", "resolve", "apply", "write") programmatically instead. It will not only fix this issue but also avoid useless double code execution.
As a side note, I tried to solve this issue for me by setting enableOffline to false. It didn't work because the command (export-env) is executed anyway and the check is done later.
Thanks!