Can't get custom routing to work?

Hi there.

I am trying to customise the routing on my app but for some reason the custom functions I am passing in are making no difference. Can you see if I’m doing anything wrong?..

I have added console.log() calls to just see if the code is even running, but I’m getting nothing in the console.

var search = instantsearch({
	// Replace with your own values
	appId: '{{ env('ALGOLIA_APP_ID') }}',
	apiKey: '{{ env('ALGOLIA_SEARCH_ONLY') }}', // admin
	indexName: '{{ env('ALGOLIA_INDEX') }}',
	// urlSync: true,
	facets: ['active'],
	routing: {
		stateMapping: {
			stateToRoute: function(uiState) {
				console.log(uiState);
				return {
					query: uiState.query,
					test: 'test'
				}
			},
			routeToState: function(routeState) {
				console.log(routeState);
				return {
					query: routeState.query,
					test: 'test'
				}
			}
		},

	},
	searchParameters: {
		highlightPreTag: '<span class="ash">',
		highlightPostTag: '</span>',
		hitsPerPage: 10,
		filters: 'active:true AND (active_end < 0 OR active_end > ' + Date.now() +' OR has_active_date != 1) AND (active_start < 0 OR active_start < ' + Date.now() + ' OR has_active_date != 1)',
		attributesToSnippet: [
			'article:50',
			'content:50',
			'leaders_notes:50',
			'intro:50',
		],
		snippetEllipsisText: '&hellip;',
		facets: ['table']
	}
});

Here’s your code in a sandbox, and I see it working. Can you explain what you have different than that sandbox that causes it not to work?

You can edit it and then send that link when you get back to a situation which breaks.