diff --git a/src/node_sqlite.cc b/src/node_sqlite.cc index 9c3aa6e0b4dc5f..91b80b4fb44c26 100644 --- a/src/node_sqlite.cc +++ b/src/node_sqlite.cc @@ -2157,7 +2157,8 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo& args) { Local filterFunc = filterValue.As(); - context.filterCallback = [&](std::string_view item) -> bool { + context.filterCallback = + [env, db, filterFunc](std::string_view item) -> bool { // If there was an error in the previous call to the filter's // callback, we skip calling it again. if (db->ignore_next_sqlite_error_) {