skip to Main Content

My next js was working as expected till I tried to do npm run build and npm run export, then the error started to appear whenever I tried to do npm run dev

Failed to compile

Next.js (14.2.7)
./src/@menu/styles/styles.module.css
TypeError: root.markClean is not a function

and here is how my ./src/@menu/styles/styles.module.css looks :

.ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

2

Answers


  1. You are running the commands in the wrong order:

    • npm run build – generate the build in .next
    • npm run export – generate a static export
    • npm run dev – run the dev preview

    You can’t run a dev preview on a production build. Instead change the order of commands to:

    • npm run build – generate the build in .next
    • npm run export – generate a static export
    • npm run start – run the production preview
    Login or Signup to reply.
  2. At current time, this error seems to be related to postcss >= 8.4.42
    look into the postcss issue tracker

    8.4.43 should have fixed it, but it still persist for me with nextjs 14.2.7.

    You can downgrade to postcss 8.4.41 for a temporary fix and wait for a bugfix.

     npm install [email protected]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search