Description
After successfully logging in, the gtc.find() method throws a TargetCloseError. The browser closes prematurely before the selector .box.r-profile-box can be found.
Steps to Reproduce
- Initialize Gtc with headless puppeteer
- Login successfully (QR code scan)
- Call
gtc.find('ID', '6283812345678')
- Error occurs
Code
const { Gtc } = require('gtc-js')
const gtc = new Gtc({
cookiePath: './cookie.json',
showQr: false,
puppeteer: {
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
},
})
gtc.on('logged', async (logged) => {
if (logged) {
const tags = await gtc.find('ID', '6283812345678')
console.log(tags)
}
})
await gtc.init()
Error
TargetCloseError: Waiting for selector `.box.r-profile-box` failed: Protocol error (Runtime.callFunctionOn): Target closed
Environment
- Node.js: v24.11.1
- gtc-js: latest
- puppeteer: 22.15.0
- OS: Ubuntu 24.04 (codespace)
Description
After successfully logging in, the
gtc.find()method throws aTargetCloseError. The browser closes prematurely before the selector.box.r-profile-boxcan be found.Steps to Reproduce
gtc.find('ID', '6283812345678')Code
Error
Environment