当我尝试import the JS SDK Veriff时,我得到了以下错误。我如何解决这个错误?
类型错误:默认值(...)不是函数
import { Component, OnInit } from '@angular/core';
import Veriff from '@veriff/js-sdk';
@Component({
selector: 'hp',
templateUrl: './hp.component.html',
styleUrls: ['./hp.component.css']
})
export class HPComponent implements OnInit {
constructor( ) { }
ngOnInit(): void {
const v = Veriff({
host:'',
apiKey:'',
parentId:'',
onSession: (err:any, res:any) => {
}
});
我还尝试将以下内容添加到我的tsconfig.json中。
{
"compileOnSave": false,
"compilerOptions": {
...
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
1条答案
按热度按时间gudnpqoy1#
您需要将导入更改为:
(摘自https://github.com/Veriff/veriff-js-sdk#install-js-sdk上的文档)