The name 'GridBlock' does not denote a valid type ('not found'). What?????

I am doing a Minecraft project using a YouTube video and I have typed this code in javascript:

var prefab : GridBlock;
var gridX = 5;
var gridY = 5;
var gridZ = 5;
var spacing = 1;

function Start () 
{
				for (var y = 0; y < gridY; y++){
				for (var x = 0; x < gridX; x++){
				for (var z = 0; z < gridZ; z++){
		
				var pos = Vector3(x,y,z) * spacing;
				Instantiate(prefab, pos, Quaternion.identity);
		
		
		
			}
		 }
       }
 }

and it says The name ‘GridBlock’ does not denote a valid type (‘not found’). I have set the prefab as a cube called GridBlock.

You are typecasting your prefab as GridBlock, this is a type that doesn’t exist (e.g. you don’t have a script called GridBlock attached to the object). When you typecast, you are typecasting to a component type or a variable type.

You probably just want to typecast your prefab to a Transform :

var prefab : Transform;