After writing some seemingly irrelevant code, my project has stopped working altogether and I am getting "Cannot find package" errors for seemingly every package.
For example, this error I am getting after the code was working fine:
error - Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'react-hook-form' imported from /Users/~/dev/podcast/.next/server/pages/create.js
Did you mean to import react-hook-form-virtual-91dc5e5cb0/0/cache/react-hook-form-npm-7.22.1-0f35fbb533-52e0187503.zip/node_modules/react-hook-form/dist/index.cjs.js?
I have tried removing my node_modules and yarn.lock then reinstalling with yarn install to no avail.
My guess is that I may have broken something in my package.json or other configuration files since now it is suggesting to import from node_modules instead?
Node v16.13.0 React v17.0.2 Yarn v3.1.1