ulixee / hero

The web browser built for scraping
MIT License
881 stars 44 forks source link

".for is not iterable" Fatal Error On Page Navigation #299

Closed Cmeesh11 closed 2 weeks ago

Cmeesh11 commented 1 month ago

I get the following error on certain websites that seemingly happens whenever I navigate between pages:

  origin: 'uncaughtException',
  context: {},
  sessionId: null,
  sessionName: undefined
} TypeError: .for is not iterable
    at DomStorageTracker.onDomStorageCleared (/usr/src/app/agent/main/lib/DomStorageTracker.ts:277:20)
    at DevtoolsSession.emit (node:events:531:35)
    at DevtoolsSession.emit (/usr/src/app/node_modules/commons/lib/TypedEventEmitter.ts:158:18)
    at DevtoolsSession.onMessage (/usr/src/app/agent/main/lib/DevtoolsSession.ts:115:12)
    at Connection.onMessage (/usr/src/app/agent/main/lib/Connection.ts:83:23)
    at process.processImmediate (node:internal/timers:485:21)
    at process.callbackTrampoline (node:internal/async_hooks:130:17)
/usr/src/app/node_modules/@ulixee/unblocked-agent/lib/DomStorageTracker.js:178
        for (const [key] of list) {
                       ^

TypeError: .for is not iterable
    at DomStorageTracker.onDomStorageCleared (/usr/src/app/agent/main/lib/DomStorageTracker.ts:277:20)
    at DevtoolsSession.emit (node:events:531:35)
    at DevtoolsSession.emit (/usr/src/app/node_modules/commons/lib/TypedEventEmitter.ts:158:18)
    at DevtoolsSession.onMessage (/usr/src/app/agent/main/lib/DevtoolsSession.ts:115:12)
    at Connection.onMessage (/usr/src/app/agent/main/lib/Connection.ts:83:23)
    at process.processImmediate (node:internal/timers:485:21)
    at process.callbackTrampoline (node:internal/async_hooks:130:17)

This seems to only occur when loading a userProfile from a logged in session. If I catch the error by modifying the code locally, it works fine with no issues. Right now, this crashes my containers as a result of this not being caught anywhere.

blakebyrnes commented 1 month ago

Thanks for logging this. Could you attach or send me a session database for this? Would be very helpful.

Cmeesh11 commented 1 month ago

@blakebyrnes Do you have Discord? I can send it to you there.

blakebyrnes commented 1 month ago

Yeah, I'm blakeb in the ulixee discord

blakebyrnes commented 2 weeks ago

Fixed in alpha 30