Level / browser-level

An abstract-level database for browsers, backed by IndexedDB.
MIT License
47 stars 5 forks source link

How to configure Vite? #13

Closed nichoth closed 8 months ago

nichoth commented 8 months ago

Tried the example in README —

const { BrowserLevel } = require('browser-level')

// Create a database called 'example'
const db = new BrowserLevel('example', { valueEncoding: 'json' })

Got an error:

Uncaught TypeError: Class extends value undefined is not a constructor or null

image

This is using vite to bundle some code with ESM import statements.

jacoscaz commented 8 months ago

@nichoth try installing the userland events module from NPM, possibly along with @types/events.

nichoth commented 8 months ago

Thanks; I can confirm installing events has fixed.