yeojz / otplib

:key: One Time Password (OTP) / 2FA for Node.js and Browser - Supports HOTP, TOTP and Google Authenticator

Home Page:https://otplib.yeojz.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build electronjs app with otplib

cyrilfr opened this issue · comments

I want to build an electronjs app in Angular 8 with otplib. When I want to build the app, I get an error:

ERROR in ../node_modules/@otplib/core/utils.d.ts:190:9 - error TS1086: An accessor cannot be declared in an ambient context.

190     get options(): Partial<T>;
            ~~~~~~~
../node_modules/@otplib/core/utils.d.ts:194:9 - error TS1086: An accessor cannot be declared in an ambient context.

194     set options(options: Partial<T>);
            ~~~~~~~

Use of otplib:

import { authenticator } from 'otplib';

if (authenticator.check(token, secret)) {

}

Electronjs version: 7.2.3
otplib version: ^12.0.1
TypeScript version: ~3.5.3

I've been able to build with this setting in tsconfig.json:

"compilerOptions": {
  "skipLibCheck": true
}