coreui / coreui-free-react-admin-template

Open source admin template based on Bootstrap 5 and React.js
https://coreui.io/product/free-react-admin-template/
MIT License
4.6k stars 2.33k forks source link

npm run build "Failed to compile." #373

Closed manishoctal closed 2 years ago

manishoctal commented 2 years ago

I have attached the logs, while creating a production build, it throws me an error.

chum-admin.df4d9596-0969-4065-8063-8698a68a86e4.log

image

Alejandro151148 commented 2 years ago

tengo el mismo error, se logro resolver de alguna manera?

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

luizcsbh commented 2 years ago

Hello everyone, I had a similar problem and to solve it I had to do some things like update my Node.js version to 16.14.2 create a webpack file and add two libraries

{
    test: /\.(scss)$/,
    use: [{
      loader: 'style-loader', // inject CSS to page
    }, {
      loader: 'css-loader', // translates CSS into CommonJS modules
    }, {
      loader: 'postcss-loader', // Run post css actions
      options: {
        plugins: function () { // post css plugins, can be exported to postcss.config.js
          return [
            require('precss'),
            require('autoprefixer')
          ];
        }
      }
    }, {
      loader: 'sass-loader' // compiles Sass to CSS
    }]
  }
 npm install --save-dev prettier

and in my package.json file insert the library

"resolutions": {
    "react-scripts/postcss-preset-env/postcss-custom-properties": "^10.0.0"
  },

and finally

 npm install
thnardi commented 2 years ago

Hi @luizcsbh i'm having the same issue here and cannot figure out your answare, especially the code snippet above you referenced webpack.

I have no experience with webpack at all and since the template in question already has his own integration and context it gets even more complicated.

Could you provide a more complete answer, showing the full code of the webpack file, where you put it on project and any context you find necessary.

thank you very much!

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

manishoctal commented 2 years ago

It is still showing an error. @thnardi Can you explain more?

manishprajapatidev commented 2 years ago

I fixed it by doing a good hack.

src\scss_variables.scss

$enable-grid-classes: false !default;

joefelx commented 1 year ago

Try this! Sometimes linting causes issues. Add these code in next.config.js

module.exports = {
  eslint: {
    ignoreDuringBuilds: true,
  },
}