Skip to content

Commit c1c8aa4

Browse files
committed
ok just use textencoder directly
1 parent f08a252 commit c1c8aa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/replay/src/util/createReplayEnvelope.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';
2-
import { createEnvelope, createEventEnvelopeHeaders, encodeUTF8, getSdkMetadataForEnvelopeHeader } from '@sentry/utils';
2+
import { createEnvelope, createEventEnvelopeHeaders, getSdkMetadataForEnvelopeHeader } from '@sentry/utils';
33

44
/**
55
* Create a replay envelope ready to be sent.
@@ -21,7 +21,7 @@ export function createReplayEnvelope(
2121
// If string then we need to encode to UTF8, otherwise will have
2222
// wrong size. TextEncoder has similar browser support to
2323
// MutationObserver, although it does not accept IE11.
24-
length: typeof recordingData === 'string' ? encodeUTF8(recordingData).length : recordingData.length,
24+
length: typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length,
2525
},
2626
recordingData,
2727
],

0 commit comments

Comments
 (0)