Just updated rudder-sdk-js package to v2.47.0 and ...
# support
p
Just updated rudder-sdk-js package to v2.47.0 and realized that it's loading bugsnag. I already have Sentry loading, so it's not ideal for me to take that additional hit. Any way to turn it off?
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
h
Hello @proud-animal-97803 👋 Can you try out our latest v3 SDK, where you can turn off this feature by not including that plugin? https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/v3/
p
Hi Sai, thanks for a quick reply. Just to confirm, am I replacing rudder-sdk-js with @rudderstack/analytics-js?
Also, it would be great if your docs specified which Content Security Policy to modify as for example, v3 uses "connect-src": ["https://api.rudderstack.com/"]
After installing, I get 9
not valid JSON
errors index.ts:32 RS SDK Store clientDataInCookie:: Failed to retrieve or parse data for "rl_user_id" from storage: Unexpected token 'R', "RudderEncr"... is not valid JSON console.error @ client.js:2 window.console.error @ next-dev.js:23 eval @ console.js:44 outputLog @ index.js:529 error @ index.js:529 onError @ index.js:615 onError @ index.js:966 get @ index.js:954 getEntryValue @ index.js:1414 getUserId @ index.js:1417 syncStorageDataToState @ index.js:1385 init @ index.js:1383 onPluginsReady @ index.js:1566 eval @ index.js:1553 E.c @ index.js:525 r @ index.js:525 set @ index.js:525 initialize @ index.ts:32 register @ index.js:592 eval @ index.js:765 register @ index.js:765 eval @ index.js:758 Promise.then (async) eval @ index.js:758 registerRemotePlugins @ index.js:758 init @ index.js:735 onConfigured @ index.js:1571 eval @ index.js:1553 E.c @ index.js:525 r @ index.js:525 n @ index.js:525 processConfig @ index.js:1159 eval @ index.js:792 Promise.then (async) getAsyncData @ index.js:792 getConfig @ index.js:1170 init @ index.js:1149 loadConfig @ index.js:1563 onBrowserCapabilitiesReady @ index.js:1554 eval @ index.js:1553 E.c @ index.js:525 r @ index.js:525 x @ index.js:525 E.c @ index.js:525 O @ index.js:525 startLifecycle @ index.js:1553 load @ index.js:1550 load @ index.js:1647 getInstance @ rudderStack.ts:11 await in getInstance (async) track @ rudderStack.ts:35 RSTrack @ usePageViewTrack.tsx:42 checkAndLogEvent @ useEngagedVisitTrack.tsx:40 eval @ useEngagedVisitTrack.tsx:19 sentryWrapped @ helpers.js:99 setTimeout (async) eval @ trycatch.js:103 startTimer @ useEngagedVisitTrack.tsx:16 eval @ useEngagedVisitTrack.tsx:50 commitHookEffectListMount @ react-dom.development.js:23145 commitPassiveMountOnFiber @ react-dom.development.js:24921 commitPassiveMountEffects_complete @ react-dom.development.js:24886 commitPassiveMountEffects_begin @ react-dom.development.js:24873 commitPassiveMountEffects @ react-dom.development.js:24861 flushPassiveEffectsImpl @ react-dom.development.js:27034 flushPassiveEffects @ react-dom.development.js:26979 eval @ react-dom.development.js:26764 workLoop @ scheduler.development.js:266 flushWork @ scheduler.development.js:239 performWorkUntilDeadline @ scheduler.development.js:533 Show 58 more frames Show less index.ts:32 RS SDK Store clientDataInCookie:: Failed to retrieve or parse data for "rl_trait" from storage: Unexpected token 'R', "RudderEncr"... is not valid JSON console.error @ client.js:2 window.console.error @ next-dev.js:23 eval @ console.js:44 outputLog @ index.js:529 error @ index.js:529 onError @ index.js:615 onError @ index.js:966 get @ index.js:954 getEntryValue @ index.js:1414 getUserTraits @ index.js:1420 syncStorageDataToState @ index.js:1385 init @ index.js:1383 onPluginsReady @ index.js:1566 eval @ index.js:1553 E.c @ index.js:525 r @ index.js:525 set @ index.js:525 initialize @ index.ts:32 register @ index.js:592 eval @ index.js:765 register @ index.js:765 eval @ index.js:758 Promise.then (async) eval @ index.js:758 registerRemotePlugins @ index.js:758 init @ index.js:735 onConfigured @ index.js:1571 eval @ index.js:1553 E.c @ index.js:525 r @ index.js:525 n @ index.js:525 processConfig @ index.js:1159 eval @ index.js:792 Promise.then (async) getAsyncData @ index.js:792 getConfig @ index.js:1170 init @ index.js:1149 loadConfig @ index.js:1563 onBrowserCapabilitiesReady @ index.js:1554 eval @ index.js:1553 E.c @ index.js:525 r @ index.js:525 x @ index.js:525 E.c @ index.js:525 O @ index.js:525 startLifecycle @ index.js:1553 load @ index.js:1550 load @ index.js:1647 getInstance @ rudderStack.ts:11 await in getInstance (async) track @ rudderStack.ts:35 RSTrack @ usePageViewTrack.tsx:42 checkAndLogEvent @ useEngagedVisitTrack.tsx:40 eval @ useEngagedVisitTrack.tsx:19 sentryWrapped @ helpers.js:99 setTimeout (async) eval @ trycatch.js:103 startTimer @ useEngagedVisitTrack.tsx:16 eval @ useEngagedVisitTrack.tsx:50 commitHookEffectListMount @ react-dom.development.js:23145 commitPassiveMountOnFiber @ react-dom.development.js:24921 commitPassiveMountEffects_complete @ react-dom.development.js:24886 commitPassiveMountEffects_begin @ react-dom.development.js:24873 commitPassiveMountEffects @ react-dom.development.js:24861 flushPassiveEffectsImpl @ react-dom.development.js:27034 flushPassiveEffects @ react-dom.development.js:26979 eval @ react-dom.development.js:26764 workLoop @ scheduler.development.js:266 flushWork @ scheduler.development.js:239 performWorkUntilDeadline @ scheduler.development.js:533 Show 58 more frames Show less index.ts:32 RS SDK Store clientDataInCookie:: Failed to retrieve or parse data for "rl_group_id" from storage: Unexpected token 'R', "RudderEncr"... is not valid JSON console.error @ client.js:2 window.console.error @ next-dev.js:23 eval @ console.js:44 outputLog @ index.js:529 error @ index.js:529 onError @ index.js:615 onError @ index.js:966 get @ index.js:954 getEntryValue @ index.js:1414 getGroupId @ index.js:1423 syncStorageDataToState @ index.js:1385 init @ index.js:1383 onPluginsReady @ index.js:1566 eval @ index.js:1553 E.c @ index.js:525 r @ index.js:525 set @ index.js:525 initialize @ index.ts:32 register @ index.js:592 eval @ index.js:765 register @ index.js:765 eval @ index.js:758 Promise.then (async) eval @ index.js:758 registerRemotePlugins @ index.js:758 init @ index.js:735 onConfigured @ index.js:1571 eval @ index.js:1553 E.c @ index.js:525 r @ index.js:525 n @ index.js:525 processConfig @ index.js:1159 eval @ index.js:792 Promise.then (async) getAsyncData @ index.js:792 getConfig @ index.js:1170 init @ index.js:1149 loadConfig @ index.js:1563 onBrowserCapabilitiesReady @ index.js:1554 eval @ index.js:1553 E.c @ index.js:525 r @ index.js:525 x @ index.js:525 E.c @ index.js:525 O @ index.js:525 startLifecycle @ index.js:1553 load @ index.js:1550 load @ index.js:1647 getInstance @ rudderStack.ts:11 await in getInstance (async) track @ rudderStack.ts:35 RSTrack @ usePageViewTrack.tsx:42 checkAndLogEvent @ useEngagedVisitTrack.tsx:40 eval @ useEngagedVisitTrack.tsx:19 sentryWrapped @ helpers.js:99 setTimeout (async) eval @ trycatch.js:103 startTimer @ useEngagedVisitTrack.tsx:16 eval @ useEngagedVisitTrack.tsx:50 commitHookEffectListMount @ react-dom.development.js:23145 commitPassiveMountOnFiber @ react-dom.development.js:24921 commitPassiveMountEffects_complete @ react-dom.development.js:24886 commitPassiveMountEffects_begin @ react-dom.development.js:24873 commitPassiveMountEffects @ react-dom.development.js:24861 flushPassiveEffectsImpl @ react-dom.development.js:27034 flushPassiveEffects @ react-dom.development.js:26979 eval @ react-dom.development.js:26764 workLoop @ scheduler.development.js:266 flushWork @ scheduler.development.js:239 performWorkUntilDeadline @ scheduler.development.js:533 Show 58 more frames ...
h
@proud-animal-97803, the config URL change is part of the breaking changes.
Also, it seems like you've not configured to migrate the storage data. Please head over to that section in the docs and also include the appropriate plugin.
p
I have the following plugins listed:
Copy code
plugins: ["BeaconQueue", "DeviceModeDestinations", "ExternalAnonymousId", "NativeDestinationQueue",
  "StorageEncryptionLegacy", "StorageEncryption", "StorageMigrator",
  "XhrQueue", "OneTrustConsentManager", "KetchConsentManager"]
h
This looks fine. Did you also set the
storage.migrate
flag to true in load options?
p
No, but I will now.
h
The encryption version should be either not specified or
v3
p
I don't have it specified.
👍 1
I think migrate: true, might have solved it.
h
Yup.
p
I will deploy to staging and see if it throws any more errors.
h
Cool
p
Thanks Sai!
🙌 1
One error is visible: _app-87ac45ab8dcd98cd.js:27 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'page') points to this line:
Copy code
let s = {
            init: o,
            page: function() {
                for (var e = arguments.length, t = Array(e), a = 0; a < e; a++)
                    t[a] = arguments[a];
                return o().then(e=>e.page(...t)) <-------
h
The snippet doesn't seem to be from the SDK. Can you please double-check?
Also, what's
e
in
e.page
?
p
I think it's coming from
Copy code
rudder.page()
I pasted the code into your direct message channel