PiwikPRO / ngx-piwik-pro

Dedicated Piwik PRO library that helps with implementing Piwik PRO Tag Manager and the Piwik PRO tracking client in Angular 8+ applications.
MIT License
3 stars 3 forks source link

Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler] #36

Open ClementBu opened 2 months ago

ClementBu commented 2 months ago

Hello,

I work in a company using Piwik on our angular for analytics purpose. I have just upgraded to the latest version of the package on one of our project (npm install @piwikpro/ngx-piwik-pro@latest) and when I run ng serve I get errors: X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

Steps to reproduce

(Environment: node 20.9.0 / npm 10.1.0 / Angular CLI 17.3.9)

  1. Start a blank angular project:ng new test-piwik ;
  2. Install the latest version of the plugin: npm install @piwikpro/ngx-piwik-pro@latest ;
  3. Import NgxPiwikProModule in your appConfig; add the line bellow to appConfig.providers array: importProvidersFrom( NgxPiwikProModule.forRoot('my-id', 'my-container-url') )

image

  1. Run ng serve

Console output:

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/content-tracking/content-tracking.service.d.ts:1:32:
  1 │ import { ContentTracking } from '@piwikpro/tracking-base-library';
    ╵                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/cookie-management/cookie-management.service.d.ts:1:33:
  1 │ import { CookieManagement } from '@piwikpro/tracking-base-library';
    ╵                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/custom-dimensions/custom-dimensions.service.d.ts:1:33:
  1 │ import { CustomDimensions } from '@piwikpro/tracking-base-library';
    ╵                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/custom-event/custom-events.service.d.ts:1:28:
  1 │ import { CustomEvent } from '@piwikpro/tracking-base-library';
    ╵                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/data-layer/data-layer.service.d.ts:1:26:
  1 │ import { DataLayer } from '@piwikpro/tracking-base-library';
    ╵                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/download-and-outlink/download-and-outlink.service.d.ts:1:35:
  1 │ import { DownloadAndOutlink } from '@piwikpro/tracking-base-library';
    ╵                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/e-commerce/e-commerce.service.d.ts:1:26:
  1 │ import { eCommerce } from '@piwikpro/tracking-base-library';
    ╵                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/goal-conversions/goal-conversions.service.d.ts:1:32:
  1 │ import { GoalConversions } from '@piwikpro/tracking-base-library';
    ╵                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/page-views/page-views.service.d.ts:1:26:
  1 │ import { PageViews } from '@piwikpro/tracking-base-library';
    ╵                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/site-search/site-search.service.d.ts:1:27:
  1 │ import { SiteSearch } from '@piwikpro/tracking-base-library';
    ╵                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/user-management/user-management.service.d.ts:1:31:
  1 │ import { UserManagement } from '@piwikpro/tracking-base-library';
    ╵                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X [ERROR] TS2307: Cannot find module '@piwikpro/tracking-base-library' or its corresponding type declarations. [plugin angular-compiler]

node_modules/@piwikpro/ngx-piwik-pro/lib/services/user-management/user-management.service.d.ts:9:93:
  9 │ ...>): Promise<import("@piwikpro/tracking-base-library").VisitorInfo>;

Thanks for your help!

Best regards, Clément

auto200 commented 2 months ago

Hi @ClementBu thank you for reporting the issue. While we work on the solution, can you try adding@piwikpro/tracking-base-library manually as temporary fix? npm i @piwikpro/tracking-base-library

ClementBu commented 2 months ago

Hi @auto200, Thank you for your reply. your fix npm i @piwikpro/tracking-base-library did the job 👍