Next.js: Cannot find module 'ajv/lib/compile/equal'

Created on 29 Nov 2018  路  6Comments  路  Source: vercel/next.js

Bug report

Describe the bug

It throw error Cannot find module 'ajv/lib/compile/equal' when perform build via next build

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Install dependencies by using yarn
  2. Run next build
  3. See the error

Expected behavior

It should build successfully.

Screenshots

On my Macbook

image

Also on Drone in CI process.

image

System information

  • Version of Next.js: 7.0.2

Additional context

I think the problem itself is because ajv just bump it's version to 6.6.0 which remove equal function.

Work around

For those who also get this error, you can add ajv as dependencies with exact version 6.5.5

"ajv": "6.5.5"

Most helpful comment

As stated in https://github.com/epoberezkin/ajv/issues/889.

Adding the following lines to package.json worked for yarn.

"resolutions": {
    "ajv": "6.5.5"
},

All 6 comments

As stated in https://github.com/epoberezkin/ajv/issues/889.

Adding the following lines to package.json worked for yarn.

"resolutions": {
    "ajv": "6.5.5"
},

This is definitely a bug that needs to be resolved.

This solution works. I was having trouble all morning. Thank you!

I got this error with next@canary, not [email protected] .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

havefive picture havefive  路  3Comments

DvirSh picture DvirSh  路  3Comments

sospedra picture sospedra  路  3Comments

ghost picture ghost  路  3Comments

knipferrc picture knipferrc  路  3Comments