Reputation: 523
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)
Upvotes: 12
Views: 7114
Reputation: 891
I had a similar problem, where I kept getting TypeScript type errors for a file in my Nextjs app that didn't exist any more. Just deleting .next/
didn't work, so I used a bigger hammer and it worked:
rm -rf .next
rm -rf node_modules
npm install
tsc --build --clean
Upvotes: 0
Reputation: 523
I solved it by deleting the .next
folder that includes the cache.
Upvotes: 28