Closed vladfrangu closed 3 years ago
Apparently it does not work as you'd expect (TS is on my side and wants .d.ts
file too! :D), here is what happens when required in the SDK:
> apify@1.1.1 clean
> rm -rf ./build ./types
Error: node_modules/@apify/storage-local/dist/database_connection_cache.d.ts(1,35): error TS7016: Could not find a declaration file for module 'better-sqlite3-with-prebuilds'. '/home/runner/work/apify-js/apify-js/node_modules/better-sqlite3-with-prebuilds/lib/index.js' implicitly has an 'any' type.
Try `npm install @types/better-sqlite3-with-prebuilds` if it exists or add a new declaration (.d.ts) file containing `declare module 'better-sqlite3-with-prebuilds';`
npm ERR! code 2
https://github.com/apify/apify-js/pull/971/checks?check_run_id=2168177002
Apparently it does not work as you'd expect (TS is on my side and wants
.d.ts
file too! :D), here is what happens when required in the SDK:> apify@1.1.1 clean > rm -rf ./build ./types Error: node_modules/@apify/storage-local/dist/database_connection_cache.d.ts(1,35): error TS7016: Could not find a declaration file for module 'better-sqlite3-with-prebuilds'. '/home/runner/work/apify-js/apify-js/node_modules/better-sqlite3-with-prebuilds/lib/index.js' implicitly has an 'any' type. Try `npm install @types/better-sqlite3-with-prebuilds` if it exists or add a new declaration (.d.ts) file containing `declare module 'better-sqlite3-with-prebuilds';` npm ERR! code 2
That... kinda makes sense since the module itself lacks typings. I'll look into PR-ing the types to the prebuilds repo, that should fix it!
@vladfrangu no need. @B4nan will do it tomorrow. He just finished some other work on the prebuilds package so he's familiar with it.
better-sqlite3-with-prebuilds@7.1.7
now includes the typings, already updated it here, looks like its working fine
Awesome! Thanks a lot @B4nan! 🎉
Notes
better-sqlite3
typings (intellisense + TS error)