mongoose-findorcreate icon indicating copy to clipboard operation
mongoose-findorcreate copied to clipboard

Could not find a declaration file for module 'mongoose-findorcreate'.

Open Arunps94 opened this issue 5 years ago • 6 comments

TypeError: User.findOrCreate is not a function

Arunps94 avatar Jul 29 '20 14:07 Arunps94

Ya gotta require it lol

CodeVisionary avatar Aug 22 '21 09:08 CodeVisionary

Ya gotta require it lol

did required it but still same error

akpunekar avatar Sep 22 '21 04:09 akpunekar

Would need a little more to go on to help out here..

Did you install the module? Did you call .plugin() on your schema passing in the required module?

drudge avatar Sep 22 '21 13:09 drudge

I am working with findOrCreate right now. I have installed with and followed documentations on how to implement it. I am still getting the "No declaration file" as well stated by the original post. Is it missing in the API file itself? I am using the latest version of the npm package and latest version of Node.js

Kofi-D-Boateng avatar Oct 16 '21 00:10 Kofi-D-Boateng

try to require it with @Virsion, or find the package name in your node_modules, it should be like that, const findOrCreate = require('[email protected]');

abdelrhman0-0 avatar Feb 16 '22 16:02 abdelrhman0-0

Within your working directory,

  1. create a folder named "types".
  2. Within "types" folder create another folder named "mongoose-findorcreate".
  3. Now within "mongoose-findorcreate" folder create a file "index.d.ts" ( here .d.ts is extension) and within this file write "declare module 'mongoose-findorcreate';" and save it.
  4. Now after few seconds decleration warning should stop and the module will work fine.

m-ville avatar Feb 28 '22 17:02 m-ville

A problem is popping up : TypeError: Cannot read properties of undefined (reading 'ES6')

codeRohan22 avatar Mar 08 '23 16:03 codeRohan22

Same Problem: TypeError: Cannot read properties of undefined (reading 'ES6')

psykat1116 avatar Mar 11 '23 12:03 psykat1116

A problem is popping up : TypeError: Cannot read properties of undefined (reading 'ES6')

Same Problem: TypeError: Cannot read properties of undefined (reading 'ES6')

I don't think that it's related to this module. It's just a logic error (JS ES6) where you are trying to read properties of something which is undefined. You can google it :)

m-ville avatar Mar 11 '23 16:03 m-ville

I don't think that it's related to this module

but this error arises after downloading files respective to this module. Then i don't how can we say the problem is not related to this module

Sagayaraj8939 avatar Mar 27 '23 19:03 Sagayaraj8939

Try version 4.0.0

drudge avatar Mar 27 '23 20:03 drudge

Try version 4.0.0

it worked thanks

Sagayaraj8939 avatar Mar 29 '23 07:03 Sagayaraj8939

Try version 4.0.0

I'm using version 4.0.0 but I still get an error

RattyJhay avatar Apr 19 '23 14:04 RattyJhay

Try version 4.0.0

I'm using version 4.0.0 but I still get an error

https://github.com/drudge/mongoose-findorcreate/issues/27#issuecomment-1054474600

drudge avatar Apr 19 '23 14:04 drudge