jquery - Value of type “jQueryStatic<TElement extends Node>” is not callable -


issue: visual studio intellisense yells @ $: value of type “jquerystatic<telement extends node>” not callable

example code (all instances of $, really):

const emaildiv = $("<div>", { "class": "email-item" }); $(containerid).append(emaildiv); 

setup:

tsconfig.ts:

 {    "compileroptions": {      "lib": [ "es2015", "es2015.iterable", "dom" ],      "noimplicitany": true,      "noemitonerror": true,      "removecomments": false,      "sourcemap": true,      "target": "es5"    },    "files": [      // bunch of local files...    ],    "compileonsave": true  } 

.csproj:

   <propertygroup>      <targetframework>netcoreapp2.0</targetframework>      <typescripttoolsversion>2.3</typescripttoolsversion>    </propertygroup>     <itemgroup>      <packagereference include="microsoft.aspnetcore.all" version="2.0.0" />      <packagereference include="microsoft.visualstudio.web.codegeneration.design" version="2.0.0" />    </itemgroup>     <itemgroup>      <dotnetclitoolreference include="microsoft.visualstudio.web.codegeneration.tools" version="2.0.0" />    </itemgroup>     <itemgroup>      <!-- other .ts files -->      <typescriptcompile include="scripts\scripts.ts" />    </itemgroup>     <itemgroup>      <folder include="wwwroot\scripts\" />    </itemgroup>   </project> 

everything builds , works fine. has clue?

value of type “jquerystatic” not callable

caused compatability issues between type definiton , typescript compiler version.

fix

upgrade typescript latest (2.5.2) , make sure jquery.d.ts (or @types/jquery) date.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -