ofPolyline out of range vertices error

Hello,
So I thought of playing with OF and browser and I wrote a sample example with ofPolyline drawing.

Adds vertices in mousedrag and renders the polyline in draw().

//--------------------------------------------------------------
void ofApp::draw(){

ofSetColor(ofColor::white);
line.draw();    

}

//--------------------------------------------------------------
void ofApp::mouseDragged(int x, int y, int button){

line.addVertex(x, y, 0.0);

}

The sample starts fine in browser but after a couple of line strokes, I see the below error in JS console.

[GroupMarkerNotSet(crbug.com/242999)!:D0E6B75DEF7F0000]GL ERROR :GL_INVALID_OPERATION : glDrawArrays: attempt to access out of range vertices in attribute 3

Not sure if this is a bug.

By the way the test app runs fine without any issues on native OSX.

Many thanks
Gracias
Dece