79368612

Date: 2025-01-19 08:22:51
Score: 0.5
Natty:
Report link

I have found the error:

This Types module is probably required for use in typescript:

https://www.npmjs.com/package/@types/better-sqlite3

If you install this module and do the import via import * as Database from 'better-sqlite3', then everything works as desired (almost). The important thing is that the compiler gives you an error for the iteratiion for example:

Type 'IterableIterator<unknown>' can only be iterated through 
when using the '--downlevelIteration' flag or
with a '--target' of 'es2015' or higher.

8 for(const row of stmt.iterate()) {

You should therefore set the target to “target”: “es2015”, in the compiler options, if you want to use this Feature.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: UsAA12