Resolve is not a funtcion

Hello, I upgraded from version 5.7.13 to 6.0.11 by copying the files framework7.bundle.min.css and framework7.bundle.min.js but I am getting the following error when I try to open a route: routes.js: 186 Uncaught TypeError: resolve is not a function
at XMLHttpRequest.xhr.onreadystatechange.

I made the update because my mobile app does not work the history when it is executed from a web browser, I remain attentive to your comments. Thank you.

You’ll need to make a few more changes to your project to successfully migrate to v6, beyond simply copying the new files.

Take a look at this article for all the changes required: https://framework7.io/docs/migration-from-v5.html

thanks for your answer, but the issue continues, the error is: resolve is not a function
at XMLHttpRequest.xhr.onreadystatechange, the code of my route is the next:

path: ‘/promociones/’,
url: ‘./pages/promociones.html’,
name: ‘promociones’,
beforeEnter: function (routeTo, routeFrom, resolve, reject)
{

		var xhr = new XMLHttpRequest();
		xhr.open("POST", urlapp+"inc/conexion.php",true);
		xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xhr.send();
		xhr.onreadystatechange = function()
		{
			if(xhr.readyState == 4)
			{
				if(xhr.status == 200)
					resolve();
				else
				{
				app.toast.show({text: 'Es necesario una conexión activa a Internet', 
                                            closeTimeout: 2000, cssClass: 'toastwarning'});
					reject();
				}
			}
		}	

}

Seems like you didn’t read migration guide -> https://framework7.io/docs/migration-from-v5.html#route-callback-context

I resolved it with this: beforeEnter: function ({routeTo, routeFrom, resolve, reject}).
thanks.

1 Like