Closed jack-pallot closed 3 years ago
import { history } from 'instantsearch.js/es/lib/routers';
https://codesandbox.io/s/happy-mayer-7gb3h?file=/src/app.js:222-281
this is how the history router is imported in es module. Sorry that the umd version doesn't give a warning to use the correct import
Thanks, that works perfectly!
🐛 Bug description
When accessing instantsearch.routers.history on my instantsearch instance, I get an undefined error, as if it doesn't exist on the module.
_instantsearch2.default.routers is undefined
However, if I copy the same version of instantsearch.js from a CDN (https://cdn.jsdelivr.net/npm/instantsearch.js@4) and do:
import instantsearch from './instantsearch.js'
Then I can access routers.history just fine.
Is it missing in some way from the NPM package? Or, is there an alternative way to import it?
🔍 Bug reproduction
https://codesandbox.io/s/patient-surf-cej8u?file=/src/app.js