Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw when localConfig is a function that returns a promise #612

Merged
merged 1 commit into from
Jul 16, 2019

Conversation

Munter
Copy link
Contributor

@Munter Munter commented Jul 15, 2019

I attempted to use an async function in .eleventy.js because I wanted to try something depending on disk access, and usually do those things async. It turned out everything I tried to configure didn't work. The reason for this was that the config resolution doesn't handle async or promises, and just went ahead and merged my returned promise with the default config.

This PR makes the config resolution throw if a localConfig function returns a promise. Changing the entire flow to support async can be a major undertaking, but at least this addition will help future users identify their mistake clearly if they make the same one.

@zachleat
Copy link
Member

Beautifully concise PR, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants