Getting error with xhr2 and Babylon.js NullEngine

Hello all! I am experiencing a problem when using xhr2 and the Babylon Null Engine.
When I use the following simple code:

 global.XMLHttpRequest = require('xhr2').XMLHttpRequest;
 var options = {width: ground_size[0], height: ground_size[1],
 subdivisions: 100, minHeight: -118,  maxHeight: 92};
 var ground = BABYLON.MeshBuilder.CreateGroundFromHeightMap("ground", 
"/images/heightMap.jpg", options, scene);

I get an error:

 throw new NetworkError(`Unsupported protocol ${this._url.protocol}`);

After searching some other problems, I searched about this problem and found a link here: Loading models in NullEngine - Questions & Answers - HTML5 Game Devs Forum. However, this link seems to be talking about the Scene Loader, while my problem is doesn’t use the scene loader. What is the problem here? How can I fix it?

At a first glance it is not related to Babylon.js here and the message suggest it is a protocol unsupported so I would suppose it is because you are trying to load a relative path. Could you try with the path of an image stored on a server.