next.js

Nextjs trying to find a file that doesn't exist anymore


I changed a file name from columns.tsx to columns.ts but Nextjs is still looking for the columns.tsx file. If I rename the file back to columns.tsx, it's now trying to find the columns.ts version.

This is while running next dev. I tried next build but without success.

If I make a copy of the file to have one columns.ts and one columns.tsx then it works.

Any clue as to why it happens and how to fix it?

wait  - compiling...
error - ./components/ui/tables/ReactTable/columns.tsx
Error: Failed to read source code from [...]/components/ui/tables/ReactTable/columns.tsx

Caused by:
    No such file or directory (os error 2)

Solution

  • I solved it by deleting the .next folder that includes the cache.