schema-utils: TypeError: Ajv is not a constructor

Bug report

we recently updated our angular poject to v13.x.x now when i running ng serve i get an error:

Actual Behavior

[error] TypeError: Ajv is not a constructor
    at Object.<anonymous> (./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> (./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)
    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> (./node_modules/mini-css-extract-plugin/dist/index.js:8:20)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)

in the validate.js line 21 it says require(“ajv”).default which is undefined - only require(“ajv”) returns the correct object

Expected Behavior

How Do We Reproduce?

Please paste the results of npx webpack-cli info --aditional-package schema-utils here, and mention other relevant information

PS: ^-- there is a ‘d’ missing in the header

System: OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa) CPU: (16) x64 AMD Ryzen 9 5950X 16-Core Processor Memory: 3.05 GB / 17.58 GB Binaries: Node: 16.13.1 - /usr/bin/node npm: 8.3.0 - /usr/local/bin/npm Browsers: Firefox: 95.0.1 Packages: babel-loader: ^8.2.3 => 8.2.3 compression-webpack-plugin: ^8.0.1 => 8.0.1 ts-loader: ^9.2.6 => 9.2.6 webpack: ^5.65.0 => 5.65.0 worker-loader: ^3.0.8 => 3.0.8

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

also check wether that version is still the latest one of its package just in case

@alexander-akait yeah, I think so too and I’d love to submit an issue to them, but I’m not sure how to explain this accurately.

@jonnytest1 Can you report to npm?

oh 😅 thanks that worked