I found an answer that helped, in vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php:148 change to this
//Prepare reference data
$referenceData['table'] = $table;
$referenceTableName = $referenceData['referenceTable'];
$referenceData['column'] = $table->getColumnByName($referenceData['column']);
if(!isset($this->tables[$referenceTableName])){
var_dump($tableName);exit;
}
$referenceData['referenceTable'] = $this->tables[$referenceTableName];
$referenceData['referenceColumn'] = $referenceData['referenceTable']->getColumnByName(
$referenceData['referenceColumn']
);
it will return the table that is giving errors. You should override this file so you can edit, in my case I just wanted to use one time so edited directly in vendor and then reverted it, if you want to keep it override the file. I don't advise doing this on a production server. Hope it helps someone!