Search code examples
node.jsexpresswebstorm

How do I resolve JetBrains WebStorm 'Unresolved variable webServ' warning?


I'm utilizing WebStorm IDE for node.js development and I'm trying to cleanup all the WebStorm warnings and errors.

The remaining error is a 'Unresolved variable webServ' warning, but the use of the req.params.webServ is correct.

I don't want to just remove the WebStorm 'Unresolved variable...' warning.

How do I resolve this WebStorm IDE warning?

enter image description here


Solution

  • As webServ is not defined anywhere in your code (except for root path string passed to delete()), it can't be resolved using static code analysis. You can suppress such warnings for statement using comments (hit Alt+Enter, then hit Right, choose Suppress for statement). See also https://youtrack.jetbrains.com/issue/WEB-17419#comment=27-1058451, https://intellij-support.jetbrains.com/hc/en-us/community/posts/206349469-disable-unresolved-variable-on-json-object-received-by-ajax-call for other possible workarounds