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

toUpperCase Error @ulixee/unblocked-agent/lib/NetworkManager #345

Open
kriskratz opened this issue Dec 13, 2024 · 0 comments
Open

toUpperCase Error @ulixee/unblocked-agent/lib/NetworkManager #345

kriskratz opened this issue Dec 13, 2024 · 0 comments

Comments

@kriskratz
Copy link

kriskratz commented Dec 13, 2024

Changing line 317 in @ulixee/unblocked-agent/lib/NetworkManager from

.map(x => x[0].toUpperCase() + x.slice(1))

to

.map(x => { if(typeof x[0] !== 'undefined') return x[0].toUpperCase() + x.slice(1)} )

fixes the problem for me.

{
  'sec-ch-ua-platform': '"macOS"',
  Authorization: 'Intuit_APIKey intuit_apikey=prdakyreswUFDpkOPDkky63TSWvxZbtemfYVms81, intuit_apkey_version=1.0',
  Referer: 'https://quickbooks.intuit.com/',
  '-X-DEVICEID': 'a',
  'Accept-Language': 'en-US,en;q=0.9',
  'sec-ch-ua': '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"',
  '-X-APPID': "'Intuit.data.entdataproc.trackingcoreclient'",
  '-X-INTUIT_TID': 'a',
  'sec-ch-ua-mobile': '?0',
  'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36',
  'Content-Type': 'application/json'
} Error
    at NetworkManager.mergeRequestHeaders (/.../agent/main/lib/NetworkManager.ts:415:30)
    at NetworkManager.onNetworkRequestWillBeSent (/.../agent/main/lib/NetworkManager.ts:383:10)
    at DevtoolsSession.emit (node:events:524:28)
    at DevtoolsSession.emit (/.../node_modules/commons/lib/TypedEventEmitter.ts:162:18)
    at DevtoolsSession.onMessage (/.../agent/main/lib/DevtoolsSession.ts:117:12)
    at Connection.onMessage (/.../agent/main/lib/Connection.ts:87:23)
    at process.processImmediate (node:internal/timers:493:21)
2024-12-13T16:54:26.837Z ERROR [hero-core/index] UnhandledError(fatal) {
  origin: 'uncaughtException',
  context: {},
  sessionId: null,
  sessionName: undefined
} TypeError: Cannot read properties of undefined (reading 'toUpperCase')
    at /.../agent/main/lib/NetworkManager.ts:421:8
    at Array.map (<anonymous>)
    at NetworkManager.mergeRequestHeaders (/.../agent/main/lib/NetworkManager.ts:421:8)
    at NetworkManager.onNetworkRequestWillBeSent (/.../agent/main/lib/NetworkManager.ts:383:10)
    at DevtoolsSession.emit (node:events:524:28)
    at DevtoolsSession.emit (/.../node_modules/commons/lib/TypedEventEmitter.ts:162:18)
    at DevtoolsSession.onMessage (/.../agent/main/lib/DevtoolsSession.ts:117:12)
    at Connection.onMessage (/.../agent/main/lib/Connection.ts:87:23)
    at process.processImmediate (node:internal/timers:493:21)
Error: /.../node_modules/@ulixee/unblocked-agent/lib/NetworkManager.js:321
                .map(x => x[0].toUpperCase() + x.slice(1))
                               ^

TypeError: Cannot read properties of undefined (reading 'toUpperCase')
    at /.../agent/main/lib/NetworkManager.ts:421:8
    at Array.map (<anonymous>)
    at NetworkManager.mergeRequestHeaders (/.../agent/main/lib/NetworkManager.ts:421:8)
    at NetworkManager.onNetworkRequestWillBeSent (/.../agent/main/lib/NetworkManager.ts:383:10)
    at DevtoolsSession.emit (node:events:524:28)
    at DevtoolsSession.emit (/.../node_modules/commons/lib/TypedEventEmitter.ts:162:18)
    at DevtoolsSession.onMessage (/.../agent/main/lib/DevtoolsSession.ts:117:12)
    at Connection.onMessage (/.../agent/main/lib/Connection.ts:87:23)
    at process.processImmediate (node:internal/timers:493:21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant