You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using $contentDocument to get the location of an iframe which is redirected once it loads but I get as error on the line with await f.$contentDocument.location.href. It sometimes works though without any error.
TypeError: Cannot read properties of undefined (reading 'id')
at CoreTab.getCoreFrameForMeta (C:\Users\Vihanga\Documents\GitHub\scrape\node_modules\.pnpm\@[email protected]\node_modules\client\lib\CoreTab.ts:238:51)
at C:\Users\Vihanga\Documents\GitHub\scrape\node_modules\.pnpm\@[email protected]\node_modules\client\lib\DomExtender.ts:206:49
at async getAwaitedState (C:\Users\Vihanga\Documents\GitHub\scrape\node_modules\.pnpm\@[email protected]\node_modules\client\lib\SetupAwaitedHandler.ts:105:28)
at async Object.createNodePointer (C:\Users\Vihanga\Documents\GitHub\scrape\node_modules\.pnpm\@[email protected]\node_modules\client\lib\SetupAwaitedHandler.ts:74:54)
at async AwaitedHandler.createNodePointer (C:\Users\Vihanga\Documents\GitHub\scrape\node_modules\.pnpm\@[email protected]\node_modules\files\2-finalized\awaited-dom\base\AwaitedHandler.ts:33:12)
at async NodeFactory.createInstanceWithNodePointer (C:\Users\Vihanga\Documents\GitHub\scrape\node_modules\.pnpm\@[email protected]\node_modules\files\2-finalized\awaited-dom\base\NodeFactory.ts:23:19)
The text was updated successfully, but these errors were encountered:
That's an annoying error. There's a high likelihood of frames coming and going, which is likely happening here and just not emitting a meaningful error. Can you try/catch around the $contentDocument line?
I think I get the same error when I do "await hero.querySelector(iframe).$contentDocument"
/git/hero/build/client/lib/CoreTab.js:156
if (!this.frameEnvironmentsById.has(frameMeta.id)) {
^
TypeError: Cannot read properties of undefined (reading 'id')
at CoreTab.getCoreFrameForMeta (/git/hero/client/lib/CoreTab.ts:238:51)
at /git/hero/client/lib/DomExtender.ts:209:26
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Also if I do hero.getFrameEnvironment(hero.querySelector(iframe)) then it returns null but the frame is still clearly in hero.frameEnvironments so it shouldn't be detached.
Very strange. It only happens sometimes for some iframes, but not always.
I am using
$contentDocument
to get the location of an iframe which is redirected once it loads but I get as error on the line withawait f.$contentDocument.location.href
. It sometimes works though without any error.Error:
The text was updated successfully, but these errors were encountered: