2

I am trying to leverage golden-layout docking library. I have everything installed for my angular project but I am hitting an error that I cannot seem to get around.

** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Date: 2017-11-28T04:04:54.440Z                                                t Hash: bff1ad470576d56127a4
Time: 28376ms
chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 2.93 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 636 bytes [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 503 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 854 kB [initial] [rendered]

ERROR in node_modules/golden-layout/index.d.ts(15,20): error TS2304: Cannot find name 'JQuery'.
node_modules/golden-layout/index.d.ts(64,93): error TS2304: Cannot find name 'JQuery'.
node_modules/golden-layout/index.d.ts(138,49): error TS2304: Cannot find name 'JQuery'.
node_modules/golden-layout/index.d.ts(668,27): error TS2304: Cannot find name 'JQuery'.
node_modules/golden-layout/index.d.ts(766,22): error TS2304: Cannot find name 'JQuery'.
node_modules/golden-layout/index.d.ts(771,28): error TS2304: Cannot find name 'JQuery'.
node_modules/golden-layout/index.d.ts(776,32): error TS2304: Cannot find name 'JQuery'.
node_modules/golden-layout/index.d.ts(818,22): error TS2304: Cannot find name 'JQuery'.
node_modules/golden-layout/index.d.ts(823,27): error TS2304: Cannot find name 'JQuery'.
node_modules/golden-layout/index.d.ts(828,27): error TS2304: Cannot find name 'JQuery'.


webpack: Failed to compile.

I saw other another post and it is blank with no answers. When I originally got this error I did some research. I realized there was a typings problem. I went directly to the module files, and I could see the errors in the index.d.ts file. JQuery reference could not be found. So I googled around on how to fix that. The solution was to run npm install @typings/jquery. This solved my errors in the file. However, I am still getting the errors from cli when I try to run ng serve even though the errors are fixed in the index.d.ts file. I am sort of at a loss on how to move forward here.

Is there a way to just use the javascript file in angular instead of trying to use the module? Here is a plunker of it working with angular. I can see that they are just adding the script file directly to the index.html file. I have added the script file to the angular-cli.json file and it does not fix the problem. Angular still tries to use the module and hence the typing file. Any ideas or potential solutions? I feel like there is a cache somewhere that needs to be reset because I fixed the @typings error.

4
  • just needed to add the TS compiler option --skipDefaultLibCheck ....don't like it. Not sure of the implications entirely yet. Commented Nov 29, 2017 at 3:30
  • did u get your problem solved. I am going through the same Commented Aug 18, 2019 at 17:18
  • yeah, its in the comment above but again that was back in 2017. Commented Aug 18, 2019 at 20:37
  • I got it solved after install jquery types. Commented Aug 19, 2019 at 6:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.