question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing module in `next/server/pages/api`

See original GitHub issue

Using a brand new project bootstrapped with yarn create keystone app trying to run using yarn dev

On boot of app, after the App UI is ready, this comes in:

Error: Cannot find module '/Users/liamdoyle/Developer/theshoregroup/keystonecms/.keystone/admin/.next/server/pages/api/__keystone_api_build'
Require stack:
- /Users/liamdoyle/Developer/theshoregroup/keystonecms/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.dev.js
- /Users/liamdoyle/Developer/theshoregroup/keystonecms/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.js
- /Users/liamdoyle/Developer/theshoregroup/keystonecms/node_modules/@keystone-6/core/bin/cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.mod._resolveFilename (/Users/liamdoyle/Developer/theshoregroup/keystonecms/node_modules/next/build/webpack/require-hook.ts:141:26)
    at Function.resolve (node:internal/modules/cjs/helpers:108:19)
    at initKeystone (/Users/liamdoyle/Developer/theshoregroup/keystonecms/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.dev.js:223:36)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/liamdoyle/Developer/theshoregroup/keystonecms/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.dev.js',
    '/Users/liamdoyle/Developer/theshoregroup/keystonecms/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.js',
    '/Users/liamdoyle/Developer/theshoregroup/keystonecms/node_modules/@keystone-6/core/bin/cli.js'
  ]
}

Isn’t related to my dependancies - went down and up a 0.0.x version with no change. Also happened on the Azure Example

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rburgstcommented, Apr 28, 2022

I guess I will create a new issue as this one is closed

0reactions
jasonheo729commented, Nov 10, 2022

I got that error when I was using v16.13.0. It works with another node versions like v16.16.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

module-not-found - Next.js
The module you're trying to import is in a different directory; The module you're trying to import has a different casing; The module...
Read more >
Nextjs export gives Cannot find module for page
I wanted to export the site with some dynamic routes. My pages folder structure is like below page locales [locale] [slug].js. When I...
Read more >
Next.js: The Good, Bad and Ugly - An Idiosyncratic Blog
This method is used when we want to pre-render a page on each request using the data returned by getServerSideProps . Unlike getStaticProps...
Read more >
next-i18next - npm
To do that, you can pass an array of required namespaces for each page into serverSideTranslations . You can see this approach in...
Read more >
Top 5 next-server Code Examples - Snyk
entryModule !== module) { return moduleSourcePostModule } // Check if the chunk is a page if (!IS_BUNDLED_PAGE_REGEX.test(chunk.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found