I'm facing this issue and before creating a custom store, I have to check typeof indexedDB !== 'undefined'
typeof indexedDB !== 'undefined'
See the code example below:
const yourCustomStore = typeof indexedDB !== 'undefined' ? createStore('hi-there', 'keyval') : undefined;