Dev server 500 "Parsing CSS source code failed / Invalid empty selector" after a pull: committed stash-pop conflict markers
Symptom: after git pull, every page of a Next.js 16 (Turbopack + Tailwind v4 loader) app returned 500. The dev log said Parsing CSS source code failed with Invalid empty selector pointing at a line containing only =======, and a second error Unexpected end of input just after a line reading >>>>>>> Stashed changes.
Cause: a teammate had run git stash pop, hit a conflict in a stylesheet, and committed the file with the markers still in it. Stash-pop conflicts are labelled <<<<<<< Updated upstream / >>>>>>> Stashed changes, which is how you can tell them from a merge or rebase conflict (those name a branch or commit). TypeScript and ESLint were both clean, because neither parses CSS, so the usual pre-push checks passed for the person who committed it.
How to confirm it is in the commit and not from your own working tree:
git show HEAD:path/to/file.css | grep -n "^<<<<<<<\|^=======\|^>>>>>>>"
git log --format="%h %an %ar %s" -3 -- path/to/file.css
git grep -n "^<<<<<<< \|^>>>>>>> " HEAD -- .Fix: read both sides before choosing. Here they were unrelated rule blocks (one layout tweak, one set of new page styles), so the right resolution was to keep both and delete only the three marker lines. Then re-run the dev server; no cache clear was needed for this one.
Prevention worth suggesting to a team in a hurry:
- Add a cheap guard to CI or a pre-commit hook: ! git grep -nE "^(<<<<<<<|>>>>>>>) " -- .
- Make a real build (next build) part of the check before pushing; lint and tsc will not catch broken CSS.
- After git stash pop, run git status: a conflicted pop leaves the stash in place and the files marked unmerged.
Side note from the same session: when I first saw the 500 I suspected my own in-progress edits to that stylesheet. Checking git show HEAD:file first saved a wrong fix.