'NPM RUN BUILD ERROR in ./node_modules/@fortawesome/fontawesome-svg-core/styles.css

My Error Capture

ERROR in ./node_modules/@fortawesome/fontawesome-svg-core/styles.css (./node_modules/@nuxt/postcss8/node_modules/css-loader/dist/cjs.js??ref--3-oneOf-1-1!./node_modules/@nuxt/postcss8/node_modules/postcss-loader/dist/cjs.js??ref--3-oneOf-1-2!./node_modules/@fortawesome/fontawesome-svg-core/styles.css) Module build failed (from ./node_modules/@nuxt/postcss8/node_modules/postcss-loader/dist/cjs.js): ParserError: Syntax Error at line: 1, column 30 at /home/simrs/adamklinik/frontend/node_modules/@fortawesome/fontawesome-svg-core/styles.css:200:3

I use nuxt.js and tailwind



Solution 1:[1]

For anyone who stumbles over this issue: I solved it by following this answer: https://stackoverflow.com/a/67827344/6098257

In my case I just had to set postcss-custom-properties to false.

build: {
    postcss: {
      plugins: {
        "postcss-custom-properties": false
      },
    },
  }

Solution 2:[2]

Try to do npm install first, then rerun with npm run build.

Solution 3:[3]

Try to do steps:

  • npm uninstall @nuxtjs/fontawesome @fortawesome/free-solid-svg-icons @fortawesome/free-brands-svg-icons -D
  • npm i @nuxtjs/fontawesome @fortawesome/free-solid-svg-icons @fortawesome/free-brands-svg-icons -D

Or you can manual update two packages (@fortawesome/free-brands-svg-icons and @fortawesome/free-solid-svg-icons) to v6.x

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Wildanzr
Solution 3 Mr Brave