[Solved] Can’t fix this error using OpenLayers v6.3.1 release

GaryM Asks: Can’t fix this error using OpenLayers v6.3.1 release
I’m very new at using OpenLayers. I really would like to test the consumption of a WFS xml file being returned from a REST call. Using Openlayers v6.3.1 release:

OpenLayers – Get the Code

I coded up Thomas Gratier’s Block that works with a WFS xml file (thank you for this):

Solution to https://gis.stackexchange.com/questions/288068/adding-all-polygons-in-gml-from-mapserver-to-openlayers-using-wfs/288086?noredirect=1#comment461737_288086

My code is exactly as is shown on that web page with the only exception being that I am using the URL provided in the mapserver.org site:

WFS — MapServer 7.6.4 documentation

… That URL being:

https://demo.mapserver.org/cgi-bin/wfs? SERVICE=WFS& VERSION=1.0.0& REQUEST=getfeature& TYPENAME=continents& MAXFEATURES=100

When I run this using npm, I keep getting this error:

TileLayer.js:161 Uncaught TypeError: tileSource.getTileGridForProjection is not a function

As stated I’m really new at using the OpenLayers API.

Am I getting this error because of the mapserver.org URL I am using?

Am I doing something wrong or missing something?

Or is this a bug in the latetest version of OpenLayers?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.