WebStorm gives me a warning of "Unrecognized function or method" on functions like:
I've tried to Enabling the NodeJs core libraries and to install
under Preferences > JavaScript > Libraries
But this has not solved my problem. Does someone knows a solution?
This issue is tracked as https://youtrack.jetbrains.com/issue/WEB-17099; please see https://youtrack.jetbrains.com/issue/WEB-17099#comment=27-1441265 for possible workaround
This is possible solution working for me without any issues.
Moving the relative path out of the require() statement as follows.
const PATH = '../models/';
const User = require(PATH + 'user');
Alternatively
Do not import Schema separately.
Just import mongoose like this
const mongoose = require('mongoose');
and use mongoose.Schema
to access Schema
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With