segmentio / consent-manager

Drop-in consent management plugin for analytics.js
https://segmentio.github.io/consent-manager/
MIT License
341 stars 144 forks source link

Various typescript errors during build #354

Closed eshaibu closed 1 year ago

eshaibu commented 1 year ago

**Others partly resolved**
- The js-cookie library error
https://github.com/segmentio/consent-manager/blob/master/src/consent-manager-builder/preferences.ts#L1-L2 
Resolved by installing v2 `js-cookie` (`@types/js-cookie`)

- With the consent-manager-builder/preferences.ts fike

./node_modules/@segment/consent-manager/src/consent-manager-builder/preferences.ts:3:23 Type error: Could not find a declaration file for module '@segment/top-domain'. '...../node_modules/@segment/top-domain/lib/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/segment__top-domain if it exists or add a new declaration (.d.ts) file containing declare module '@segment/top-domain';


Resolved above by declaring module

declare module '@segment/top-domain' { const a: any; export default a; }