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

Bug report: Issue with rrweb dependency when compiled for typescript app #1437

Open
jondrummond-codeo opened this issue Sep 25, 2024 · 15 comments
Labels
bug Something isn't working feature/replay

Comments

@jondrummond-codeo
Copy link

jondrummond-codeo commented Sep 25, 2024

We get the following error when trying to compile our typescript app using posthog-js.

image

Seems to have been introduced with v1.164.0

@SUM-Soft
Copy link

I have the same error.

robintown added a commit to element-hq/element-call that referenced this issue Sep 27, 2024
@medfx
Copy link

medfx commented Sep 28, 2024

Same issue with version 1.165.0.

@Predhin
Copy link

Predhin commented Oct 10, 2024

any update on this issue, its present on 1.167.0 as well

@seeplusplus
Copy link

This issue starts for me in 1.164.0 - so it was probably this #1413

@slshults slshults added bug Something isn't working feature/replay labels Oct 10, 2024
@slshults
Copy link

@slshults slshults changed the title Issue with rrweb dependency when compiled for typescript app Bug report: Issue with rrweb dependency when compiled for typescript app Oct 10, 2024
@abigailbramble
Copy link

@SUM-Soft
Copy link

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';
                                ~~~~~~~~~~~~~~

t3chguy added a commit to element-hq/element-web that referenced this issue Nov 12, 2024
github-merge-queue bot pushed a commit to element-hq/element-web that referenced this issue Nov 12, 2024
* Update all non-major dependencies

* Pin posthog-js back due to PostHog/posthog-js#1437

Signed-off-by: Michael Telatynski <[email protected]>

---------

Signed-off-by: Michael Telatynski <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <[email protected]>
@iirorahkonen
Copy link

iirorahkonen commented Nov 27, 2024

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';

@SUM-Soft
Copy link

@PostHog Any progress on this issue? The build is still breaks with 1.200.1

@codezaur
Copy link

still broken in 1.203.1.
import { record } from '@rrweb/record';
record is now not separated it's inside rrweb?

@pauldambra
Copy link
Member

pauldambra commented Dec 26, 2024

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 😅

@codezaur
Copy link

codezaur commented Dec 27, 2024

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.

@SUM-Soft
Copy link

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

image

@SUM-Soft
Copy link

SUM-Soft commented Jan 2, 2025

Setting
"skipLibCheck": true
in compilerOptions section of TSConfig solve the compile error for me.

@benHPostHog
Copy link

WhiteHatTux pushed a commit to WhiteHatTux/chai-form that referenced this issue Jan 17, 2025
considering existing compile time bug that has been happening for the
last 3 month since 1.164.0 (last stable version was 1.163.1).
PostHog/posthog-js#1437
WhiteHatTux pushed a commit to WhiteHatTux/chai-form that referenced this issue Jan 20, 2025
considering existing compile time bug that has been happening for the
last 3 month since 1.164.0 (last stable version was 1.163.1).
PostHog/posthog-js#1437
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature/replay
Projects
None yet
Development

No branches or pull requests