Bai Bing
Bai Bing

Reputation: 380

IntelliJ IDEA - nodejs plugin - passport.initialize() not resolved

I met an issue that some of the nodeJS module functions are not resolved but others are fine. Here is my step to reproduce this issue:

  1. Create a project, choose NodeJS and NPM.
  2. Choose next, the project detail snapshot is attached and click finish.
  3. In app.js, add the following line after app being declared:

    var passport = require('passport');
    app.use(passport.initialize());

  4. You should see the initialized() has underscore indicating "Unresolved function or method initialized".

I'm using the latest version of IntelliJ IDEA 2016.3.4.

I've read the relevant question, but it's not fit in my scenario. Please be noted that only passport module have this issue.

Upvotes: 1

Views: 219

Answers (2)

aristotll
aristotll

Reputation: 9177

There is a better way than manually IDE configuration I think, just add passport tying to your dependency.

https://www.npmjs.com/package/@types/passport

npm install --save @types/passport

Upvotes: 0

lena
lena

Reputation: 93778

It's a known bug, please follow WEB-18469 for updates.

As a workaround, please, try downloading passport TypeScript community stubs: File | Settings | Languages & Frameworks | JavaScript | Libraries, press Download..., choose passport from the list

Upvotes: 2

Related Questions