Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: #<Object> is not a function #39

Open
sandorvasas opened this issue Jan 19, 2021 · 2 comments
Open

TypeError: #<Object> is not a function #39

sandorvasas opened this issue Jan 19, 2021 · 2 comments

Comments

@sandorvasas
Copy link

sandorvasas commented Jan 19, 2021

Why does the following code produce the error in the title?

(async () => {
  let res = await window.db.collection('change_queue')
              .find({})
              .sort({timestamp: -1})
  res = await res.toArray()
  console.log("RES", res)
})()

typeof timestamp is Date btw. Seems to be working without the sort() part

@billypon
Copy link

billypon commented Apr 15, 2022

@sandorvasas

zangodb+1.0.8.patch

diff --git a/node_modules/zangodb/build/src/create_next_fn.js b/node_modules/zangodb/build/src/create_next_fn.js                                                                                                                                                              
index f06829b..d507816 100644
--- a/node_modules/zangodb/build/src/create_next_fn.js
+++ b/node_modules/zangodb/build/src/create_next_fn.js
@@ -4,7 +4,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
 
 var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length =
 
-var merge = require('deepmerge');
+var merge = require('deepmerge').default;
 
 var _require = require('./util.js');

@danielgwood
Copy link

@billypon thanks for the patch, it works well for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants