According to Are The Types Wrong the types for idb are not set up correctly. The main issue is that the exports property in package.json defines only one type for both the .cjs as well as the .js file:
Under moduleResolution "nodenext" or "node16" in a CJS project, this leads to an import which resolves to an ESM type declaration file, but a CommonJS JavaScript file.
According to Are The Types Wrong the types for idb are not set up correctly. The main issue is that the exports property in package.json defines only one type for both the .cjs as well as the .js file:
This is, however, not possible. It needs to export a separate type declaration file for each:
Under moduleResolution "nodenext" or "node16" in a CJS project, this leads to an import which resolves to an ESM type declaration file, but a CommonJS JavaScript file.
For context, this PR fixed the same issue in the openapi-fetch package: https://github.com/drwpow/openapi-typescript/pull/1360