0

I am using golden layout with Angular 9, however I am getting this error when I import golden layout:

import { GoldenLayout } from 'golden-layout';

ERROR in node_modules/golden-layout/dist/types/index.d.ts:505:45 - error TS1005: ',' expected. 505 export type DragStartParams = [originalX: number, originalY: number]; node_modules/golden-layout/dist/types/index.d.ts:505:64 - error TS1005: ',' expected. 505 export type DragStartParams = [originalX: number, originalY: number]; node_modules/golden-layout/dist/types/index.d.ts:506:40 - error TS1005: ',' expected. 506 export type DragStopParams = [event: PointerEvent | undefined];
node_modules/golden-layout/dist/types/index.d.ts:507:38 - error TS1005: ',' expected. 507 export type DragParams = [offsetX: number, offsetY: number, event: PointerEvent]; node_modules/golden-layout/dist/types/index.d.ts:507:55 - error TS1005: ',' expected. 507 export type DragParams = [offsetX: number, offsetY: number, event: PointerEvent]; node_modules/golden-layout/dist/types/index.d.ts:507:70 - error TS1005: ',' expected. 507 export type DragParams = [offsetX: number, offsetY: number, event: PointerEvent]; node_modules/golden-layout/dist/types/index.d.ts:508:58 - error TS1005: ',' expected. 508 export type BeforeComponentReleaseParams = [component: unknown];

Does anybody have an idea why this is happening?

Aziza Kasenova
  • 1,501
  • 2
  • 10
  • 22
JohnSlow
  • 11
  • 2
  • I've created a new angular app using: > npx @angular/cli@9 new Angular9 then i installed dependency using > npm install golden-layout And imported GoldenLayout on top of app component. Could you provide more information? What version of package are you using? Do you have some special build config in Your angular.json? – michal.materowski Jul 13 '21 at 15:55
  • Hi, Michal, thank you for your reply. I created some test projects and golden layout work perfectly on them. I believe there are some conflicts between my libraries, and this might be the reason that cause this error. Well, I solved this issue by referencing the vanilla Js GoldenLayout library and using jquery functions in angular. – JohnSlow Jul 14 '21 at 18:50
  • I'm glad You've solved the issue! Please keep be aware that using jQuery goes a little bit against the nature of JavaScript frameworks like Angular. Angular is responsible for rendering and manipulating the DOM and if you’re interfering with it using jQuery, you might get some unwanted results. – michal.materowski Jul 15 '21 at 13:36

0 Answers0