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

postcss config is not reloaded on server.restart() #15745

Closed
7 tasks done
dominikg opened this issue Jan 29, 2024 · 6 comments · Fixed by #15235
Closed
7 tasks done

postcss config is not reloaded on server.restart() #15745

dominikg opened this issue Jan 29, 2024 · 6 comments · Fixed by #15235
Labels
bug: upstream Bug in a dependency of Vite feat: css p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@dominikg
Copy link
Contributor

dominikg commented Jan 29, 2024

Describe the bug

editing postcss.config.js does not apply changes, even when there is a watcher that calls server.restart()

Reproduction

https://stackblitz.com/edit/vitejs-vite-yls5ef?file=postcss.config.js,vite.config.js&terminal=dev

Steps to reproduce

edit postcss.config.js in the reproduction, observe that console does not log load postcss config again even though it should

System Info

stackblitz vite.new + postcss

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented Jan 29, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@PengBoUESTC
Copy link
Contributor

vite load the postcss config by postcss-load-config,I think that import cache the file content, so that postcss can not get the new content of it.

@dominikg
Copy link
Contributor Author

one workaround is to not use postcss-load-config but instead import postcss.config.js in vite config and pass it to css.postcss: https://stackblitz.com/edit/vitejs-vite-uwhqtw?file=postcss.config.js,vite.config.js&terminal=dev

But i don't know if there are things in postcss config that can't be bundled into the vite config and how it would work with dependencies like a browserslist file for autoprefixer...

@bluwy
Copy link
Member

bluwy commented Feb 21, 2024

@PengBoUESTC I noticed that you submitted a fix upstream. Does that mean that if we upgrade postcss-load-config it should also fix this issue?

@bluwy bluwy added bug: upstream Bug in a dependency of Vite feat: css p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Feb 21, 2024
@PengBoUESTC
Copy link
Contributor

PengBoUESTC commented Feb 25, 2024

@PengBoUESTC I noticed that you submitted a fix upstream. Does that mean that if we upgrade postcss-load-config it should also fix this issue?

yes , And I try to update the 'postcss-load-config' dep version of vite packages ,and maybe this need more test

@bkilrain
Copy link

bkilrain commented Sep 7, 2024

Are there any known workarounds for this issue? I've cleared node_modules and browser cache... I'm still not getting updates in the compiled css.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: upstream Bug in a dependency of Vite feat: css p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants