I've just faced similar error and spent hours trying to figure it out. I was able to fix it by clearing all caches like so: yarn cache clean --all
yarn cache clean --all