Search code examples
reactjstailwind-cssnetlify

Netlify Run build won't work. because of 'Unknown Word'


Pretty self explanatory. Netlify won't build react app. Previous versions build fine. npm start works fine locally

Screenshot of Netlify Deploy window

I get similar results in Vscode running npm run build

VScode npm run build error


Solution

  • Turns out it had something to do with a key I put in tailwind.config.js as suggested by the tailwind docs:

    enter image description here

    I just had to remove the important: true, key and use the ! modifier inline

    e.g. className="!bg-green-500" Not sure why it wouldn't build with it. I updated postcss and tailwind just to make sure, but only removing it worked. Could someone who understands explain this.