Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic-selectable: error TS1086: An accessor cannot be declared in an ambient context

When building in prod mode for an ionic app -- I get

[ng] ERROR in node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable-modal.component.d.ts:13:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 13     get _canClearCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable-modal.component.d.ts:14:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 14     get _isMultipleCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable-modal.component.d.ts:15:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 15     get _isSearchingCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable-modal.component.d.ts:16:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 16     get _isIos(): boolean;
[ng]            ~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable-modal.component.d.ts:18:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 18     get _isAddItemTemplateVisibleCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:16:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 16     get _isMultipleCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:17:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 17     get _hasValueCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:18:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 18     get _hasPlaceholderCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:19:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 19     get _hasIonLabelCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:20:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 20     get _hasDefaultIonLabelCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:21:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 21     get _hasFixedIonLabelCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:22:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 22     get _hasStackedIonLabelCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:23:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 23     get _hasFloatingIonLabelCssClass(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:44:17 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 44     private get _hasInfiniteScroll();
[ng]                    ~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:45:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 45     get _shouldStoreItemValue(): boolean;
[ng]            ~~~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:70:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 70     get label(): string;
[ng]            ~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:79:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 79     get searchText(): string;
[ng]            ~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:80:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 80     set searchText(searchText: string);
[ng]            ~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:89:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 89     get isSearching(): boolean;
[ng]            ~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:98:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 98     get hasSearchText(): boolean;
[ng]            ~~~~~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:99:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 99     get value(): any;
[ng]            ~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:100:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 100     set value(value: any);
[ng]             ~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:117:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 117     get isEnabled(): boolean;
[ng]             ~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:118:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 118     set isEnabled(isEnabled: boolean);
[ng]             ~~~~~~~~~
[ng] node_modules/ionic-selectable/src/app/components/ionic-selectable/ionic-selectable.component.d.ts:126:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 126     get shouldBackdropClose(): boolean;
[ng]             ~~~~~~~~~~~~~~~~~~~

Any ideas on how to fix this?

like image 337
Mayank R Jain Avatar asked Mar 28 '20 14:03

Mayank R Jain


1 Answers

The problem is fixed by moving to

[email protected]

so just do the following:

npm install [email protected] --save 

to move to this version (I had 4.5.0) to fix the issue.

Hope this helps.

like image 81
Mayank R Jain Avatar answered Sep 18 '22 00:09

Mayank R Jain