Skip to content

Conversation

@codingnuclei
Copy link
Contributor

closes #334

Hey,

This PR ensures that the buildOptions is set in the initialize hook.
https://www.serverless.com/framework/docs/guides/plugins/creating-plugins#lifecycle-events

As per their docs the previous method meant that the serverless object passed to config() had variables that were not resolved...

Note: configuration values are only resolved after plugins are initialized. Do not try to read configuration in the plugin constructor, as variables aren't resolved yet. Read configuration in lifecycle events only.

Considerations:

  • I have removed the dependency on memoizeWith as now the buildOptions is only set once. As the class field has not changed name or the returning value, no changes are required in any other file.

@floydspace
Copy link
Owner

@codingnuclei I will need more time to test and review it, so excuse me if it hangs longer. But shallow review shows me that the fix makes sense 😀

@codingnuclei
Copy link
Contributor Author

@floydspace no worries. Let's get this right! 👍

samchungy
samchungy previously approved these changes Jul 19, 2022
Copy link
Collaborator

@samchungy samchungy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it a run locally. Looks good!

@Edweis
Copy link

Edweis commented Jul 27, 2022

Hey @codingnuclei , can we merge this PR? The fix will be appreciated. Thanks!

@codingnuclei
Copy link
Contributor Author

@Edweis hey - so as I understand it, I am unable to merge.

Think @floydspace has to 😀

@floydspace floydspace merged commit 845c7a8 into floydspace:master Jul 27, 2022
@floydspace
Copy link
Owner

Merged it, thank you for contribution

@github-actions
Copy link

🎉 This PR is included in version 1.32.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

esbuild config function is called with unresolved serverless param

4 participants