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

1

6

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?

Crabstick answered 28/3, 2020 at 14:54 Comment(0)
C
10

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.

Crabstick answered 28/3, 2020 at 14:54 Comment(1)
I had version 4.7.0 and having this issue. Downgraded to version 4.6.0 and it was resolved :)Unconditional

© 2022 - 2024 — McMap. All rights reserved.