This could be due to the module name and the instance name are the same. Example:
reg clk, reset, enable;
wire [3:0] count;
counter_tb U0 (
Try rename one of them (counter_tb) into a different name.
By sharing your code, then I can further debug and provide a better answer.
p.s. Don’t forget to Reply, and Select the Best Answer. :)