question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

inputBaggageString.split is not a function

See original GitHub issue

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.1.1

Framework Version

Link to Sentry event

https://sentry.io/organizations/anyfin/issues/3338863766/

Steps to Reproduce

  1. Upgrade to sentry/nextjs 7.1.1
  2. Have a backend running sentry/javascript using 7.0.0
  3. Trigger some requests.

Expected Result

No errors originating from sentry packgages on http calls.

Actual Result

inputBaggageString.split is not a function originating from: https://github.com/getsentry/sentry-javascript/blob/1456b9c8c62ee414fc4a6075406040fb1238a45e/packages/utils/src/baggage.ts#L74-L76

I verified this error is not triggered on the api or client routes of the nextjs package, but rather on our backend api running nextjs/javascript@7.0.0. However it only happens with requests from this specific “client” (sentry/nextjs@7.1.1).

Other sentry frontend clients connecting to the very same backend do net get this error.

Relevant section of sentry.client.config, as you can see no strange settings.

Sentry.init({
  dsn: SENTRY_DSN,
  enabled: ENVIRONMENT !== "local", // Enable only for prod envs
  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: isProduction ? 0.5 : 0,
  environment: ENVIRONMENT,
  beforeBreadcrumb: excludeGraphQLFetch, // just a  small util.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Lms24commented, Jun 24, 2022

Hi @pepf - we just released version 7.3.0. It contains a potential fix for this reported bug. Would you mind giving this version a try? Would be very much appreciated, thanks!

1reaction
lforstcommented, Jun 13, 2022

Thank you very much for the effort!

That header is indeed a standard and we’re using to propagate trace state. My current suspicion is that there are two different baggage headers on the incoming request, causing requestOptions.headers.baggage to be an array instead of a string.

I don’t believe this is something we account for yet, as it kinda is an edge case (or rather specification violation by some service within the request chain), but we probably should. Baggage propagation in general is currently a big WIP for us.

I am aware you probably don’t care about the SDK internals and just want this fixed 😄 - I am just writing my thoughts down so the rest of the team can also pick them up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: split is not a function in JavaScript | bobbyhadz
The "split is not a function" error occurs when we call the `split()` method on a value that is not of type string....
Read more >
What is causing the error `string.split is not a function`?
This is because document.location is a Location object. The default .toString() returns the location in string form, so the concatenation will trigger that....
Read more >
[Solved] TypeError: split is not a function - ItsJavaScript
The TypeError: split is not a function occurs if we call a split() method on the value that is not of a type...
Read more >
How To Fix Split is Not a Function Error in JavaScript - Isotropic
split is not a function error. The Problem. First and foremost it is important to understand the usage of the split() method. It...
Read more >
this.elementValue.split is not a function throws at
OmniscriptOptionMixin setElementFormattedValue() method throwing Uncaught TypeError: this.elementValue.split is not a function throws at" for Select Elements ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found