nuxt: Randomly Getting: Cannot find module 'pages/index.js'

Version

v2.4.5

Reproduction link

https://codesandbox.io/ (Sorry, unable to reproduce it, maybe someone else can)

Steps to reproduce

Unknown but I am not the only one having this issue: https://github.com/nuxt/nuxt.js/issues/5006#issuecomment-468197574

What is expected ?

Server should start normally.

What is actually happening?

I get this error: ‘Cannot find module ‘pages/index.js’ from ‘/Users/nahtnam/Desktop/programs.nosync/nahtnam/nahtnam’’

Additional comments?

The only weird customization I have done is move everything into an src folder. Restarting the server over and over again eventually fixes this issue

Not really sure how to extrac the stack trace but here is a screenshot of the error.

Screen Shot 2019-02-28 at 2.19.48 AM.png .

<div align="right">This bug report is available on Nuxt community (#c8751)</div>

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 13
  • Comments: 36 (3 by maintainers)

Most upvoted comments

I’m having the same issue. Ubuntu 18.04 / v2.4.5 It happens after npm run dev, when I navigate to http://localhost:3000/

Workaround is to make a small change in pages/index.vue to trigger regeneration.

@anteriovieira @damienrave After updating Nuxt to 2.5.1 this issue seems to be vanished.

Marking this as solved so far. Thanks for pinging back!