playwright-go icon indicating copy to clipboard operation
playwright-go copied to clipboard

panic in fromChannel in connection.go

Open songgao opened this issue 2 years ago • 8 comments

Hi, I have a long running process using this and ran into a panic after a while. Is this a known issue?

panic: interface conversion: interface {} is nil, not *playwright.channel

goroutine 1 [running]:
github.com/playwright-community/playwright-go.fromChannel(...)
        /Users/songgao/go/pkg/mod/github.com/playwright-community/[email protected]/connection.go:201
github.com/playwright-community/playwright-go.(*pageImpl).Reload(0xc0000e4a00?, {0x0?, 0x0?, 0xc0000a41e0?})
        /Users/songgao/go/pkg/mod/github.com/playwright-community/[email protected]/page.go:188 +0xd6

Unfortunately I don't have an easy repro. My setup involves creating a few pages in a chrome browser type and calling page.Reload() on each page periodically.

songgao avatar Jul 31 '22 01:07 songgao

Is there any movement or update on this? I'm hitting the same issue on a page.Reload() call and this issue is about all I can find on it.

xarxziux avatar Dec 09 '22 15:12 xarxziux

Pleas try the latest version

canstand avatar Sep 12 '23 16:09 canstand

same issue when I call page.Reload() periodic, using: github.com/playwright-community/playwright-go v0.4001.0

lampnick avatar Dec 22 '23 08:12 lampnick

same issue when I call page.Reload() periodic, using: github.com/playwright-community/playwright-go v0.4001.0

panic: interface conversion: interface {} is map[string]interface {}, not *playwright.channel

goroutine 136 [running]:
github.com/playwright-community/playwright-go.fromChannel({0x20551a0, 0xc0024d4d80})
	xxxxx/github.com/playwright-community/[email protected]/connection.go:348 +0x66
github.com/playwright-community/playwright-go.fromNullableChannel({0x20551a0, 0xc0024d4d80})
	xxxxx/github.com/playwright-community/[email protected]/connection.go:355 +0x3d
github.com/playwright-community/playwright-go.newFrame(0xc0002c6280, {0xc001806294, 0x5}, {0xc001899260, 0x26}, 0xc0024d4d20)
	xxxxx/github.com/playwright-community/[email protected]/frame.go:38 +0x4a5
github.com/playwright-community/playwright-go.createObjectFactory(0xc0002c6280, {0xc001806294, 0x5}, {0xc001899260, 0x26}, 0xc0024d4d20)
	xxxxx/github.com/playwright-community/[email protected]/objectFactory.go:34 +0x20f
github.com/playwright-community/playwright-go.(*connection).createRemoteObject(0xc0006200c0, 0xc0002c6280, {0xc001806294, 0x5}, {0xc001899260, 0x26}, {0x20551a0, 0xc0024d4d20})
	xxxxx/github.com/playwright-community/[email protected]/connection.go:155 +0xbf
github.com/playwright-community/playwright-go.(*connection).Dispatch(0xc0006200c0, 0xc001303ea0)
	xxxxx/github.com/playwright-community/[email protected]/connection.go:117 +0x6ce
github.com/playwright-community/playwright-go.(*connection).Start.func1()
	xxxxx/github.com/playwright-community/[email protected]/connection.go:54 +0x145
created by github.com/playwright-community/playwright-go.(*connection).Start
	xxxxx/github.com/playwright-community/[email protected]/connection.go:46 +0x85

lampnick avatar Dec 22 '23 08:12 lampnick

@lampnick interface {} is map[string]interface {}, unlike the previous issue, I can't reproduce it. Can you provide reproducible code?

canstand avatar Dec 22 '23 11:12 canstand

@lampnick interface {} is map[string]interface {}, unlike the previous issue, I can't reproduce it. Can you provide reproducible code?

call the page.Reload() every 5 seconds. It maybe reproduce in 1 hour.

lampnick avatar Jan 02 '24 01:01 lampnick

@lampnick interface {} is map[string]interface {}, unlike the previous issue, I can't reproduce it. Can you provide reproducible code?

call the page.Reload() every 5 seconds. It maybe reproduce in 1 hour.

Definitely occurs after extended use

dreams-money avatar Jan 09 '24 01:01 dreams-money

I have tested and confirmed that it‘s an upstream error, see issue https://github.com/microsoft/playwright/issues/28915

canstand avatar Jan 09 '24 13:01 canstand

Fixed in latest version.

canstand avatar Mar 13 '24 05:03 canstand