2

I had been working with vs code for a while to develop NodeJS projects however IntelliSense not working for the classes and files I am writing, I had tried the solution inside here but it did not work for me, so anyone can help me to fix this problem.

VS code version:1.25.0

NodeJS version:8.9.4

An example about IntelliSense problem:

This is a simple class This is a simple class

As you can see when I am importing it from another file no IntelliSense is working As you can see when I am importing it from another file no IntelliSense is working But the node_module files IntelliSense is working But the node_module files IntelliSense is working!

0

1 Answer 1

0

I tried to solve it with a different syntax to export the class:

class Util {
    constructor() { }

    getNumber(x, y) {
        return x * y;
    }
}

exports.default = Util;

Then, I could import the class like this

const util = require('./../util/util').default;

And the autocompletion works:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.