creativetimofficial / ct-nextjs-material-kit-pro

NextJS version of Material Kit PRO React
https://demos.creative-tim.com/nextjs-material-kit-pro/presentation
19 stars 6 forks source link

[Bug] next build fail #27

Closed jwang-lilly closed 1 year ago

jwang-lilly commented 1 year ago

Version

1.3.1

Reproduction link

https://www.creative-tim.com/new-issue/nextjs-material-kit-pro

Operating System

macOS monterey version 12.6

Device

macbook pro

Browser & Version

Chrome Version 108.0.5359.124 (Official Build) (x86_64is up to date)

Steps to reproduce

download the kit

cd kit npm install build next

What is expected?

should build successfully

What is actually happening?

adena% next build info - Linting and checking validity of types
info - Creating an optimized production build
Failed to compile.

./styles/scss/nextjs-material-kit-pro.scss To use Next.js' built-in Sass support, you first need to install sass. Run npm i sass or yarn add sass inside your workspace.

Learn more: https://nextjs.org/docs/messages/install-sass

Build failed because of webpack errors


Solution

npm run build see the screen output adena% npm run build

nextjs-material-kit-pro@1.3.1 build next build

info - Linting and checking validity of types ..warn - No ESLint configuration detected. Run next lint to begin setup info - Linting and checking validity of types
info - Creating an optimized production build
info - Compiled successfully Warning: You have opted-out of Automatic Static Optimization due to getInitialProps in pages/_app. This does not opt-out pages with getStaticProps Read more: https://nextjs.org/docs/messages/opt-out-auto-static-optimization

info - Collecting page data
Route (pages) Size First Load JS ...

(Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)

Additional comments

I encountered this issue when using "build next", it can be overcome using "npm run build". It is just strange that npm run build actually executes next build.

I am just concerned about the webpack errors.

Please note, I don't have a reproducible example because it is your own code base. I just ordered it and wanted to see if it can build.

sajadevo commented 1 year ago

@JianWang2016,

I've tested the product and the build script works smoothly also the build next is the official command for building a next.js app. Could you please check your product version on the package.json the latest version is v1.3.1.

Cheers, Sajad

sajadevo commented 1 year ago

This issue is fixed on v1.3.2