Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unhandledRejection Error [ERR_INTERNAL_ASSERTION]: Code: ERR_MODULE_NOT_FOUND #52540

Open
cfongerws opened this issue Apr 15, 2024 · 0 comments

Comments

@cfongerws
Copy link

cfongerws commented Apr 15, 2024

Version

v18.20.2

Platform

Darwin Curtiss-MBP-2.lan 21.6.0 Darwin Kernel Version 21.6.0: Mon Feb 19 20:25:23 PST 2024; root:xnu-8020.240.18.707.4~1/RELEASE_ARM64_T6000 arm64

Subsystem

No response

What steps will reproduce the bug?

yarn run build

How often does it reproduce? Is there a required condition?

Reproduces on every build.

What is the expected behavior? Why is that the expected behavior?

No error when compiling.

What do you see instead?

We have a Next.js app, version 14.2.1. We're trying to upgrade our version of Node to 18.20.2. When we run yarn run build, which is an alias for ./node_modules/.bin/next build, we get the following output:

yarn run v1.22.19
$ ./node_modules/.bin/next build
  ▲ Next.js 14.2.1
  - Environments: .env.production, .env

 ✓ Linting and checking validity of types    
   Creating an optimized production build ...
 ✓ Compiled successfully
unhandledRejection Error [ERR_INTERNAL_ASSERTION]: Code: ERR_MODULE_NOT_FOUND; The provided arguments length (2) does not match the required ones (3).
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

    at new NodeError (node:internal/errors:405:5)
    at assert (node:internal/assert:14:11)
    at getMessage (node:internal/errors:451:5)
    at new NodeError (node:internal/errors:379:21)
    at legacyMainResolve (node:internal/modules/esm/resolve:218:9)
    at packageResolve (node:internal/modules/esm/resolve:903:14)
    at moduleResolve (node:internal/modules/esm/resolve:973:20)
    at defaultResolve (node:internal/modules/esm/resolve:1193:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:373:25) {
  type: 'Error',
  code: 'ERR_INTERNAL_ASSERTION'
}

Any thoughts?

Additional information

Not sure if this helps, but here's our tsconfig.json:

{
  "extends": "@tsconfig/next/tsconfig.json",
  "compilerOptions": {
    "target": "es5",
    "baseUrl": ".",
    "paths": {
      "@/components/*": ["components/*"],
      "@/styles/*": ["styles/*"],
      "@/utils/*": ["utils/*"],
      "@/lib/*": ["lib/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant