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

Empty config crash caused by repeated require() #6

Open
kmarple1 opened this issue Jul 10, 2020 · 1 comment
Open

Empty config crash caused by repeated require() #6

kmarple1 opened this issue Jul 10, 2020 · 1 comment

Comments

@kmarple1
Copy link
Contributor

For whatever reason, babel is currently calling this plugin twice in my project (I verified this with console logs). Due to the way Node handles repeated requires, the require() call on my postcss.config.js was returning an empty object on the subsequent call. This in turn causes an error from postcss-load-config, which doesn't handle an empty config object correctly (and it would end up with the wrong options even if it did).

I've already put in a PR that resolves this issue by removing the config from Node's resolve cache before it gets re-required.

@hnrchrdl
Copy link

hnrchrdl commented May 7, 2021

encountered the same issue. the fix works for me. would be cool to have a new version on npm with the fix. thanks!

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

No branches or pull requests

2 participants