Closed MrCsabaToth closed 7 years ago
I'm using Visual Studio 2017 and this is an ASP.NET MVC 5 project (so not APS.NET Core) - just in case this matters.
I suppose that the reason of the problem is not updating free jqGrid from 4.14.0 to 4.14.1, but updating @types/jquery
package. The new versions of the files could be compiled if you add lib
option of TypeScript compiler. See the commit.
My project doesn't have any node packages. I do have bower packages though and some of the bower components pull in jQuery 3.2.1 transitively. I don't need that but at the same time I use jQuery 2.2.4 from NuGet. Can jQuery 3.x or this mixed environment be the cause of the problem.
Another thing: I don't use TypeScript by myself in my project, so I have no dependencies on it.
Can this issue be a problem with project configuration or maybe my development environment?
Sorry, but you should look at the error messages, which you posted. It's errors of compiling free-jqgrid.d.ts
file, which is type definition of free jqGrid for the usage in TypeScript. If you don't use TypeScript yourself then you just included free jqGrid in the wrong way. You need include only ui.jqgrid.min.css
and jquery.jqgrid.min.js
and optionally some language locale like grid.locale-de.js
. No .ts
file (free-jqgrid.d.ts
) need be included or compiled if you don't use free jqGrid from TypeScript.
@OlegKi For sure, thanks for the heads up! I don't include any ts, I am aware that it's only a part of the build procedure of free-jqGrid.
bundles.Add(new StyleBundle("~/CSS/projectindex").Include(
"~/Content/font-awesome.min.css",
"~/Content/themes/base/all.css",
"~/Content/ui.jqgrid.min.css",
"~/Scripts/free-jqGrid/plugins/css/ui.multiselect.min.css"));
bundles.Add(new ScriptBundle("~/bundles/jqgrid").Include(
"~/bower_components/numeral/min/numeral.min.js",
"~/Scripts/jquery.validate.unobtrusive.js",
"~/Scripts/jquery-ui-{version}.js",
"~/Scripts/free-jqGrid/i18n/min/grid.locale-en.min.js",
"~/Scripts/free-jqGrid/jquery.jqgrid.min.js",
"~/Scripts/free-jqGrid/plugins/min/ui.multiselect.js"));
Please review the issue, which you report. Your current Visual Studio project compiles TypeScipt file free-jqgrid.d.ts
, which you don't need at all. The files *.d.ts
declare JavaScript functions and types in the same way like *.h
files declare types and functions in C language. You should ask yourself: why your project compile files, which you don't use at all? Why you included the files in your project?
It's probably the best way to exclude the file free-jqgrid.d.ts
from your Visual Studio project?
For your information: jqGrid uses jQuery and thus free-jqgrid.d.ts
contains the lines
/// <reference types="jquery" />
/// <reference types="jqueryui" />
which references index.d.ts
from node_modules\@types\jquery
or node_modules\@types\jqueryui\index.d.ts
in case of usage npm package. I don't use bower since years and probably I should extend information in bower.json
to reference @types\jquery\index.d.ts
and jqueryui\index.d.ts
from https://github.com/DefinitelyTyped/DefinitelyTyped/
. On the other side the information about files isn't changed between free jqGrid 4.14.0 and 4.14.1. The only problem, which I know is that https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/jquery/index.d.ts
is changed after publishing free jqGrid 4.14.1. The version 2.0.45 of "@types/jquery" is changed now to version 3.2.5 and the latest version of the file https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/jquery/index.d.ts
requires the usage of specific TypeScript options, for example, lib: ["es2015", "es2017", "dom"]
, which I posted you before.
Ok, deleting that ts
file from the project helped. I didn't include anything manually though, it was included as a part of the package installation automatically.
I could have listened to you punctually earlier!
You don't closed the issue. Please provide the demo, which I can use to reproduce the problem or close the issue.
Sorry about that, I don't have time to isolate a demo, but the situation is simple. As I mentioned I simply upgraded and the ts file was added to my project as a result of the upgrade. I believe that's an installation/upgrade error, I leave it up to you if you close it. The solution is simple, but I think some people can run into it. I'll also keep an eye no it for future upgrade if it comes back as regression.
I came to this issue because I was having the same problem, using Visual Studio 2015 I chose to use nuget to update from 4.14.0 to 4.14.1 and got around 3000 errors, I read through this post and then just deleted the newly installed ts directory and then everything worked as it did before the upgrade.
@Blindsyde I can help you only if I can reproduce the problem, which you reports. The project defines compiling rules and options for compiling .ts tiles. Additionally it's important to know how* you included free jqGrid to your Visual Studio 2015 project. It's unclear currently whether you used NPM, NuGet, bower or some other source for the free jqGrid 4.14.1. It could be important, which version of jQuery you use in the project and from which source and with other JavaScript libraries you use. I can continue...
I repeat, that you should describe the problem so, that I could reproduce it. For example, you can describe step by step how I could create new Visual Studio 2015 project, include free jqGrid 4.14.1 and build the solution. Alternatively you can share the project, which have the problem, which you describes.
After I'll be able to reproduce the problem, I could change the sources of free jqGrid to eliminate the problem.
@MrCsabaToth Thank you very much for your post! I can reproduce the problem and it's now clear for me how to fix it.
The problem exists in NuGet package. I' add in the next release of the package (for 4.15.0) dependencies to jquery.TypeScript.DefinitelyTyped and jqueryui.TypeScript.DefinitelyTyped packages and will modify the lines
/// <reference types="jquery" />
/// <reference types="jqueryui" />
to
/// <reference path="../../typings/jquery/jquery.d.ts" />
/// <reference path="../../typings/jqueryui/jqueryui.d.ts" />
but only for the free-jqgrid.d.ts
included in NuGet package. The content of free-jqgrid.d.ts
in the standard npm package will stay unchanged. Thus I'll not modify free-jqgrid.d.ts
in the GitHub repository.
I think, I'll include additionally tsconfig.json
file in the same folder with free-jqgrid.d.ts
with the content about the following
{
"compilerOptions": {
"target": "es5",
"lib": [ "es2015", "es2017", "dom" ],
"sourceMap": true
}
}
to be sure that the TypeScript file will be compiled correctly.
Thanks once more for the test case and sorry for the late answer: I was very busy last time with my main job.
@OlegKi Glad I could help! Thanks for taking energy to fix this.
@MrCsabaToth I'm closing the issue now. I promise that the next NuGet package will contains the fixes described above. If I forget something or if you find new problems please post new issue.
Thanks @OlegKi and sorry I hadn't had time to get back to this thread.