Node.js "const {} = require('../file')" Intellisense broken after dependency imported once.
After using Intellisense to require a file dependency once (using Node.js require), there is no tooltip to require it again. I attached the example code and screenshot of a replication in a fresh project.
// index.js
const Test = {
sayhi: function () {
}
};
module.exports = { Test }
// service-1.js
// If you remove the below line, Test will have an option to require the dependency since its the first time its being included.
const {Test} = require("./index");
function main() {
Test.sayhi()
}
main();
// service-2.js
// No coding assistance to require Test when its required in service-1. This bug seems to be when a dependency is previously required.
Test
Intellisense for "Test" in service-2.js (ALT+Enter on Windows 10): https://gyazo.com/95e66b97606deb25e2c4306b9062764a
Hovering "Test" in service-2.js (IDE thinks to seem its in scope based on its require from service-1): https://gyazo.com/bae372af88cd182246f80f88b11004f2
Please let me know if you think this is an issue on my end or if its a flaw in the IDE.
Thanks!
Please sign in to leave a comment.
Works file for me in 2020.3 EAP:
What IDE version do you use? Looks similar to https://youtrack.jetbrains.com/issue/WEB-44997 that is fixed in 2020.2