File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,16 @@ export function loadDatabaseAdapter<T>(collection: T): DatabaseAdapter {
3636async function loadAdapter < T > ( collection : T ) {
3737 if ( ! db ) {
3838 const sqlite3InitModule = await import ( '@sqlite.org/sqlite-wasm' ) . then ( m => m . default )
39+ // @ts -expect-error sqlite3ApiConfig is not defined in the module
40+ globalThis . sqlite3ApiConfig = {
41+ // overriding default log function allows to avoid error when logger are dropped in build.
42+ // For example `nuxt-security` module drops logger in production build by default.
43+ silent : true ,
44+ debug : ( ...args : unknown [ ] ) => console . debug ( ...args ) ,
45+ warn : ( ...args : unknown [ ] ) => console . warn ( ...args ) ,
46+ error : ( ...args : unknown [ ] ) => console . error ( ...args ) ,
47+ log : ( ...args : unknown [ ] ) => console . log ( ...args ) ,
48+ }
3949 const sqlite3 = await sqlite3InitModule ( )
4050 db = new sqlite3 . oo1 . DB ( )
4151 }
You can’t perform that action at this time.
0 commit comments