Manually added refinement facet works but shows error?

Hi,

I have added an “invisible” refinementFacet I added via javascript. Everything works but still there is a error shown in the console:
Cannot read property 'facets' of undefined

What i’ve done is:

const search = instantsearch({
    appId: '****',
    apiKey: '****',
    indexName: '****',
    searchFunction: function(helper) {
        toppers.helper.setQuery(helper.state.query);
        toppers.helper.state.disjunctiveFacets = ["bannerpakket"];
        toppers.helper.state.disjunctiveFacetsRefinements = {bannerpakket:["1"]}; // THIS LINE WORKS BUT GIVES THE ERROR
        toppers.helper.search();
        helper.search();
    },
    routing: false
});

const toppers = instantsearch({
    appId: '****',
    apiKey: '****',
    indexName: '****',
    searchParameters: {
        hitsPerPage: 12
    }
});

Am i missing something? I even tested to add a real widget which also works and the filter even is checked with the correct value, but still the error is shown in console.

On the toppers instance itself, you can use configure to hardcode these parameters:

toppers.addWidget(
  instantsearch.widgets.configure({
    disjunctiveFacetsRefinements: { bannerpakket: ['1'] },
  })
);

Maybe I’m missing what you are trying to achieve though. Can you explain a bit more in detail what the goal is?

Thanks. That seems to work yes!