posthog-js
posthog-js copied to clipboard
Bug report: Issue with rrweb dependency when compiled for typescript app
We get the following error when trying to compile our typescript app using posthog-js.
Seems to have been introduced with v1.164.0
I have the same error.
Same issue with version 1.165.0.
any update on this issue, its present on 1.167.0 as well
This issue starts for me in 1.164.0 - so it was probably this https://github.com/PostHog/posthog-js/pull/1413
+1 https://posthoghelp.zendesk.com/agent/tickets/19196
+1 https://posthoghelp.zendesk.com/agent/tickets/19425
version 1.174.2
Error: node_modules/posthog-js/dist/module.d.ts:1:50 - error TS2307: Cannot find module 'rrweb-snapshot' or its corresponding type declarations.
1 import { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
~~~~~~~~~~~~~~~~
Error: node_modules/posthog-js/dist/module.d.ts:2:31 - error TS2307: Cannot find module '@rrweb/types' or its corresponding type declarations.
2 import { eventWithTime } from '@rrweb/types';
~~~~~~~~~~~~~~
Are there any updates or workarounds for this issue? The build still breaks with Posthog 1.190.2?
Error: node_modules/posthog-js/dist/module.d.ts:1:24 - error TS2307: Cannot find module '@rrweb/record' or its corresponding type declarations.
1 import { record } from '@rrweb/record';
Error: node_modules/posthog-js/dist/module.d.ts:2:31 - error TS2307: Cannot find module '@rrweb/types' or its corresponding type declarations.
2 import { eventWithTime } from '@rrweb/types';
@PostHog Any progress on this issue? The build is still breaks with 1.200.1
still broken in 1.203.1.
import { record } from '@rrweb/record';
record is now not separated it's inside rrweb?
can folk share what version of node and TS they're using?
we're importing posthog-js in a CI test to validate minimum supported TS version and don't get this error, so, since I can't repro it i can't suggest a fix 😅
can folk share what version of node and TS they're using?
node -v v18.16.1 [email protected]
I personally downgraded to posthog-js: 1.181.0, as was suggested in other thread, and it works now.
can folk share what version of node and TS they're using?
Node v22.12.0 typescript: 5.5.4
My build breaks with every Posthog version greater than 1.163.0
Setting
"skipLibCheck": true
in compilerOptions section of TSConfig solve the compile error for me.
+1 https://posthoghelp.zendesk.com/agent/tickets/22888
in the short term if you set skipLibCheck to true then this works for you
you can see in our CI in this repo that this TS compiles
i appreciate not everybody wants to set that
I'm currently still getting this issue as well
So many issues and comments about this for 10 months now and it's still not fixed. It's a pity, but I have little choice but to move on. You might wanna consider removing TS based frameworks from your "install" page - it's annoying to have wasted time on this.
I ran into this issue today.
Guys, we are still stuck at 1.161.6
You are a very likeable company with a great product and philosophy. I can't understand why the responsible team is just ignoring this problem.
I really love PostHog, but if we can't stay up to date, we should and we will find another analytics service :(