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?

3
  • 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? Commented Jul 13, 2021 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. Commented Jul 14, 2021 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. Commented Jul 15, 2021 at 13:36

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.