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

npx contentlayer2 build gives ENOENT error #41

Open
ham-evans opened this issue Oct 4, 2024 · 1 comment
Open

npx contentlayer2 build gives ENOENT error #41

ham-evans opened this issue Oct 4, 2024 · 1 comment

Comments

@ham-evans
Copy link

ham-evans commented Oct 4, 2024

As mentioned, running
npx contentlayer2 build
is giving the following error:

Error: ENOENT: no such file or directory, read
    at async readFileHandle (node:internal/fs/promises:553:24)
    at async getSource (node:internal/modules/esm/load:46:14)
    at async defaultLoad (node:internal/modules/esm/load:137:34)
    at async ModuleLoader.load (node:internal/modules/esm/loader:553:7)
    at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:434:45) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'read'
}

Just started happening. Running contentlayer2 0.5.1, Next.js 14.2.12 and Node 20.17.0. This is breaking next dev and next build. Do have type:module in package.json which throws webhook error as mentioned in #20 but shouldn't cause any breaking problems so think this is something else. Would love a solution ASAP. Thanks!!

@timlrx
Copy link
Owner

timlrx commented Oct 5, 2024

Next 14.2.12 seems to work fine: https://stackblitz.com/edit/github-ekmxur-jgj1xq?file=package.json

Could you create a small reproducible example?

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

2 participants