Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module and when installing dependency it doesnt compile #1532

Open
raquelsrocha opened this issue Nov 18, 2024 · 9 comments
Open
Labels
SDK Support General SDK issues rather than being related to a feature team

Comments

@raquelsrocha
Copy link

raquelsrocha commented Nov 18, 2024

Bug Description

A few months ago i was able to add posthog to my Angular project and even had it recording sessions and such.
This was just experimental so i didn't even merge the changes (just had them locally).
Now i tried to run it and it complained about not finding rrweb/record module. I installed it and then it doesn't compile due to errors in rrdom.
The only (main) difference was that i did some minor/patch updates in the whole project. So i decided to create a blank stackblitz to check if this would still happen and it did (described below).

How to reproduce

  • Stackblitz with Angular base project with just "posthog-js" added : https://stackblitz.com/edit/stackblitz-starters-dgyh5r?file=package.json
  • Run "npm install && npm start"
  • You will get the error "Cannot find module" regarding @rrweb/record and @rrweb/types
  • If you install both (as dev dependencies) then you get "cannot find "errors in rrdom/dist and rrweb/dist files.

Note: The only file besides package.json changed, was maint.ts to import posthog.

@da201501245
Copy link

I also got same issue when I try to use latest version of posthog in my angular project.

@migueldv90
Copy link

Same, I am also getting the same errors, I will have to revert back until this gets fixed.

@vvolodin
Copy link

Almost every release of posthog breaks my Angular build. This one is not an exception.

@migueldv90
Copy link

This is the second time my posthog-js has broken my angular app, I also had issues with the go lang package as well.

@jer-tx
Copy link

jer-tx commented Nov 24, 2024

Is there any workaround for this?

@Synatiic
Copy link

I totally agree and can confirm that this is not an exception.

Some try & error later I was able to find a dependency combination which seem to work.

npm install [email protected] --save-dev
npm install @rrweb/[email protected]  --save-dev
npm install [email protected]

Keeping Posthog's dependencies in own package.json is a absolute no-go and will cause more issues in future. This must be fixed.

Hope this helps, @jer-tx

@raquelsrocha
Copy link
Author

raquelsrocha commented Nov 26, 2024

I totally agree and can confirm that this is not an exception.

Some try & error later I was able to find a dependency combination which seem to work.

npm install [email protected] --save-dev
npm install @rrweb/[email protected]  --save-dev
npm install [email protected]

Keeping Posthog's dependencies in own package.json is a absolute no-go and will cause more issues in future. This must be fixed.

Hope this helps, @jer-tx

It helped me, thanks!
Will use these specific versions for now.

@robbie-c robbie-c added the SDK Support General SDK issues rather than being related to a feature team label Nov 29, 2024
@jonnyarnold
Copy link

Based on some initial research, this issue appears have been introduced in this PR: v1.163.1 doesn't have this type issue, whereas v1.164.0 does.

As an alternative workaround, users may want to consider downgrading to v1.163.1 until this is fixed.

@Roodaka
Copy link

Roodaka commented Dec 10, 2024

I totally agree and can confirm that this is not an exception.

Some try & error later I was able to find a dependency combination which seem to work.

npm install [email protected] --save-dev
npm install @rrweb/[email protected]  --save-dev
npm install [email protected]

Keeping Posthog's dependencies in own package.json is a absolute no-go and will cause more issues in future. This must be fixed.

Hope this helps, @jer-tx

It worked for me too. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Support General SDK issues rather than being related to a feature team
Projects
None yet
Development

No branches or pull requests

9 participants