CORS issue Searchbox autocomplete

I am referring this tutorial with stable version 5: Searchbox Integration

var options = {
            searchOptions: {
                key: '<your-tomtom-API-key>',
                language: 'en-GB',
                limit: 5
            autocompleteOptions: {
                key: '<your-tomtom-API-key>',
                language: 'en-GB'
        var ttSearchBox = new tt.plugins.SearchBox(, options);
        var searchBoxHTML = ttSearchBox.getSearchBoxHTML();

Getting this error:

Access to XMLHttpRequest at β€˜’ from origin β€˜http://localhost’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.

Can you check the preflight (OPTIONS request) response?

1 Like