Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

755
Views
TypeError: Ajv is not a constructor when I run npm run build

I'm stumbling on an error every time I run npm run build

error:

/node_modules/mini-css-extract-plugin/node_modules/schema-utils/dist/validate.js:66
const ajv = new Ajv({
            ^

TypeError: Ajv is not a constructor
    at Object.<anonymous> (/home/ts34mpr/website/client/node_modules/mini-css-extract-plugin/node_modules/schema-utils/dist/validate.js:66:13)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/ts34mpr/website/client/node_modules/mini-css-extract-plugin/node_modules/schema-utils/dist/index.js:6:5)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

please does anyone knows the solution or can help please! Thank you

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Same problem for me. I find if I delete node_modules and package-lock.json and then run npm install and npm run build, that solves it. Not a great answer. I'd like to know the real solution.

about 4 years ago · Juan Pablo Isaza Report

0

I have a more permanent answer than my previous one. Downgrade mini-css-extract-plugin to 2.4.7. For example:

"mini-css-extract-plugin": "2.4.7",

I tested each version from 2.5.3 down and this is most recent version where this error does not occur.

It would be nice to know why this works, but it does.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!