"2 definitions" when using module.exports to export a function wrapped in {}
See original GitHub issue- VSCode Version: 1.28.2
- OS Version: macOS 10.14
I noticed there are several issues opened against “2 definitions”, noticeably https://github.com/Microsoft/vscode/issues/51459 & https://github.com/Microsoft/TypeScript/issues/24861
But I don’t think my issue is the same (I don’t use ts or react, just nodejs code). It happens when I export like this
function downloadVoice() {
...
}
module.exports = {
downloadVoice
}
// If I export like this it will not happen
// module.exports = downloadVoice
But when I hover over to the place when the function is called, vscode can show the definition correctly,

The 2 definitions warning:

Does this issue occur when all extensions are disabled?: Yes
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
module.exports – How to Export in Node.js and JavaScript
In this article, I will show you how to share functions and values by exporting and importing modules in Node.js.
Read more >Understanding module.exports and exports in Node.js
In this article, I'll examine how to work with modules in Node.js, focusing on how to export and consume them.
Read more >The difference between module.exports and exports in Node.js
When we want to export a function or a primitive value (string, number, etc.), we need to reassign module.exports . Reassigning exports variable ......
Read more >Use Module.exports to Keep Node.js Code Organized - Medium
Let's export a single function that multiplies a number by 2 and use it in our index.js file: // helpers.js module.exports = function(x)...
Read more >Difference between "module.exports" and "exports" in the ...
module is a plain JavaScript object with an exports property. exports is a plain JavaScript variable that happens to be set to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi I believe this bug has been there for a long time and it is quite annoying. Do you have plan to fix it recently ?
I tested 1.29, it still has the problem.