I've searched for similar questions, but haven't found one that matches my issue. Can someone help me figure out what to do next?
In my Visual Studio project, I used package.json to download jquery typings into the node_modules folder:
{
"version": "1.0.0",
"name": "asp.net",
"private": true,
"devDependencies": {
"@syncfusion/ej2": "17.1.51",
"@syncfusion/ej2-base": "17.1.49",
"@syncfusion/ej2-data": "17.1.51",
"@syncfusion/ej2-inputs": "17.1.50",
...
"@types/jquery": "3.2.0"
}
}
Although my project already uses jquery 2.1.4, I added version 3.2.0 with typescript. Is this compatible? Does the types version need to match the script version?
My tsconfig.json file includes:
{
"compilerOptions": {
"noImplicitAny": false,
...
"paths": {
"@syncfusion/ej2-base": [ "./node_modules/@syncfusion/ej2-base/dist/ej2-base.umd.min.js" ],
...
"@types/jquery": [ "./node_modules/@types/jquery/index.d.ts" ]
}
},
...
}
The javascript file QBMapByState.config.js in my page has the following references:
System.config({
...
map: {
...
"@types/jquery": "../node_modules/@types/jquery/index.d.ts",
},
});
System.import('app');
Do I need to make changes here regarding the type of jquery?
In my page's typescript file QBMapByState.ts, I import various elements including jquery typing like so:
import { Maps } from "@syncfusion/ej2-maps";
import * as $ from '@types/jquery';
All dependencies are transpiling except jquery, resulting in an error:
Cannot import type declaration files. Consider importing 'jquery' instead of '@types/jquery'
How can I resolve this issue? What am I missing?
Debug Errors: https://i.stack.imgur.com/hyWR7.jpg