NFID initialization error: TypeError: (0, idb_1.openDB) is not a function

Hello everyone,

I’m currently integrating authentication using NFID into my project. In my project, I’m using Next.js and integrating authentication, for example, on the login page, where I’ve disabled SSR so I can use hooks.

My problem arises when I attempt to initialize NFID. Below, I’m providing the error code along with the initialization code for the NFID function.

Error:
Unhandled Runtime Error
TypeError: (0, idb_1.openDB) is not a function. (In ‘(0, idb_1.openDB)(dbName, version, {
upgrade: (database) => {
database.objectStoreNames;
if (database.objectStoreNames.contains(storeName)) {
database.clear(storeName);
}
database.createObjectStore(storeName);
},
})’, ‘(0, idb_1.openDB)’ is undefined)

Initialization code:
useEffect(() => {
async function initializeNFID() {
try {
const nfidInstance = await NFID.init({
application: {
name: ‘NFID Playground’,
logo: ‘https://dev.nfid.one/static/media/id.300eb72f3335b50f5653a7d6ad5467b3.svg’,
},
} as any);
setNfid(nfidInstance);
const res = nfidInstance.getIdentity();
setInfo(JSON.stringify(res));
} catch (error) {
console.error(‘Failed to initialize NFID:’, error);
}
}
initializeNFID();
}, );

I would appreciate any insights or solutions to this issue.

Thank you.