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

Fix PostCSS watcher warnings on Windows #15321

Merged
merged 3 commits into from
Dec 9, 2024
Merged

Conversation

philipp-spiess
Copy link
Member

@philipp-spiess philipp-spiess commented Dec 6, 2024

Resolves #15320
Resolves #15175

Turns out that the postcss file watcher does not like our Unix based paths and will print a warning about them. This fixes the issue by calling path.resolve() to convert it back to a Windows-style absolute path if necessary.

Test Plan

Tested on Windows with a new Next.js 14 project. Ensured that file reloads also still work (changes to the tsx file are picked up correctly). Also ensure that the CI runs on Windows.

Before

Screenshot 2024-12-06 at 13 12 23

After

Screenshot 2024-12-06 at 13 23 24

@philipp-spiess philipp-spiess marked this pull request as ready for review December 6, 2024 12:58
@philipp-spiess philipp-spiess requested a review from a team as a code owner December 6, 2024 12:58
@babaie774

This comment was marked as spam.

@aymanoid
Copy link

aymanoid commented Dec 8, 2024

This probably also fixes my issue here #15175

@philipp-spiess
Copy link
Member Author

@aymanoid Oh yep that seems like the same issue!

@philipp-spiess philipp-spiess merged commit 94a3cff into next Dec 9, 2024
1 check passed
@philipp-spiess philipp-spiess deleted the fix/windows-postcss/error branch December 9, 2024 09:44
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.

Windows: Warnings in Next.js project with the postcss extension [v4] weird webpack warning
4 participants