These are chat archives for Automattic/mongoose

13th
Dec 2017
Caleb B
@zikeji
Dec 13 2017 00:06
I think I have a lead. I think Mongoose thinks I'm running in a browser and not as Node on the serverside. How does it evaluate that?
Caleb B
@zikeji
Dec 13 2017 00:20
TypeError: Object prototype may only be an Object or null: undefined
    at Function.create (<anonymous>)
    at Object.<anonymous> (C:\projects\indev\node_modules\mongoose\lib\browserDocument.js:99:29)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\projects\indev\node_modules\mongoose\lib\document_provider.js:9:23)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\projects\indev\node_modules\mongoose\lib\types\embedded.js:7:16)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
---------------------------------------------
    at handleOperationCallback (C:\projects\indev\node_modules\mongoose\node_modules\mongodb-core\lib\connection\pool.js:468:24)
    at C:\projects\indev\node_modules\mongoose\node_modules\mongodb-core\lib\connection\pool.js:504:9
    at authenticateStragglers (C:\projects\indev\node_modules\mongoose\node_modules\mongodb-core\lib\connection\pool.js:443:16)
    at Connection.messageHandler (C:\projects\indev\node_modules\mongoose\node_modules\mongodb-core\lib\connection\pool.js:477:5)
    at TLSSocket.<anonymous> (C:\projects\indev\node_modules\mongoose\node_modules\mongodb-core\lib\connection\connection.js:331:22)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at TLSSocket.Readable.push (_stream_readable.js:208:10)
    at TLSWrap.onread (net.js:594:20)
Stack trace includes browserDocument and document_provider but in my tests it shouldn't be using browserDocument
Caleb B
@zikeji
Dec 13 2017 00:46
Sorry guys. I shouldn't have bothered you, at least, I don't think I should have. I'm using a combined Express + Mongoose and NUXT.JS w/SSR stack.
When I disable nuxt it works. Something they must have added screwed it up
John Bayron P
@johnbayronp
Dec 13 2017 02:07
good nigth
i have to error when install moongose
mongoose*
image.png
help
Caleb B
@zikeji
Dec 13 2017 02:17
That's not even a mongoose issue @johnbayronp . You've got a comment in your package.json. You can't do that.
John Bayron P
@johnbayronp
Dec 13 2017 02:22
yes , that was the problem
thanks :D
@zikeji thanks brother
Caleb B
@zikeji
Dec 13 2017 05:18
Paul "Joey" Clark
@joeytwiddle
Dec 13 2017 06:08
I see you opened issues on both projects. Nice work! I hope it gets fixed.
Caleb B
@zikeji
Dec 13 2017 06:24
Thanks! I tried troubleshooting it myself but it already took 10 hours of my life just to identify it. I'm working on a rolled back Nuxt commit but the last thing I want is for the next Nuxt release to be incompatible with Mongoose
आदित्य शर्मा
@aadii104
Dec 13 2017 16:40

hello guys I am trying to push a name in array inside an already created data by this:

UserModel.User.findOneAndUpdate(
        { userName:userName}, {$push:{companies: "hellooo"}}
    ).exec()
      .then(function(user){
          console.log(user)

but getting this error please help

error:
(node:20403) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot use 'in' operator to search for '_id' in hellooo
(node:20403) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.