#Expected ":" but found ")" in Vercel build
4 messages · Page 1 of 1 (latest)
Hi @sweet pebble. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
The error message "Expected : but found )" is a CSS syntax error. This type of error is recognized by Astro as a CSS Syntax Error, which is typically caused by a syntax issue in your CSS (such as a missing semicolon or other malformed CSS). [CSS Syntax Error]
However, the knowledge sources don't contain enough specific information to explain why this error would appear on Vercel but not locally. A few things worth noting from the available documentation:
-
It's a Vite build error — the
[vite] ✗ Build failedprefix indicates Vite is throwing this during the build process. [Unknown Vite Error] -
Node.js version differences — Vercel may be using a different Node.js version than your local environment, which could affect how certain CSS or JS is processed. You can check and configure the Node.js version in your Vercel project settings. [Node.js Version Support]
-
JS dependencies processed differently — In Astro v5, locally-linked JS dependencies are no longer processed by Vite during config loading, which can cause discrepancies between local and Vercel builds. [Upgrade to Astro v5]
Suggested steps:
- Look for any CSS that uses syntax like
:has(),:is(),:where(), or other pseudo-selectors that might be malformed — the error suggests a)was found where:was expected in a CSS rule. - Check if a specific CSS file or
<style>block is the culprit by reviewing your styles carefully. - Ensure your Node.js version on Vercel matches your local environment.