Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

4.5.3 introduces type errors #50

Open
JamesJansson opened this issue Apr 21, 2020 · 1 comment
Open

4.5.3 introduces type errors #50

JamesJansson opened this issue Apr 21, 2020 · 1 comment

Comments

@JamesJansson
Copy link

Can only replicate in 4.5.3 (4.5.2 seems to be fine). Using a standard import { AccessControl } from 'role-acl'; results in the following errors at build time.

node_modules/role-acl/lib/src/AccessControl.d.ts:320:16 - error TS1086: An accessor cannot be declared in an ambient context.

320     static get Error(): any;
                   ~~~~~

node_modules/role-acl/lib/src/core/Permission.d.ts:62:9 - error TS1086: An accessor cannot be declared in an ambient context.

62     get roles(): string[];
           ~~~~~

node_modules/role-acl/lib/src/core/Permission.d.ts:70:9 - error TS1086: An accessor cannot be declared in an ambient context.      

70     get resource(): string;
           ~~~~~~~~

node_modules/role-acl/lib/src/core/Permission.d.ts:83:9 - error TS1086: An accessor cannot be declared in an ambient context.      

83     get attributes(): string[];
           ~~~~~~~~~~

node_modules/role-acl/lib/src/core/Permission.d.ts:92:9 - error TS1086: An accessor cannot be declared in an ambient context.      

92     get granted(): boolean;
@koladilip
Copy link
Contributor

which version of typescript and Node are you using? I am not getting these errors.
I am using the following:
Node: v12.16.1,
tsc: Version 3.8.3
Are you trying from the browser by any chance?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants