7

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)
Loïc Boset
  • 343
  • 3
  • 13
  • Hi, i think this error occur because of EsLint rules. i hope this answer can help https://stackoverflow.com/a/59268871/7369564 or you can try allowing custom extensions by https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions – Saurabh Apr 15 '22 at 07:02

1 Answers1

18

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

Loïc Boset
  • 343
  • 3
  • 13