-
-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
Describe the bug
I first run a desktop test, wich works fine, but when I want to start a second test for mobile I get this error:
file:///C:/Users/benny/work/lighthouse/node_modules/unctx/dist/index.mjs:6
throw new Error("Context conflict");
^
Error: Context conflict
Any way to prevent this error or is it a bug?
Reproduction
export async function performTest(site, urls, device = 'desktop') {
return new Promise(async (resolve, reject) => {
const unlighthouse = await createUnlighthouse({
site,
urls,
lighthouseOptions: {
onlyCategories: ['performance', 'best-practices', 'accessibility', 'seo', 'pwa'],
},
puppeteerOptions: {
args: ["--no-sandbox"],
headless: true // headless works best,
},
server: {
open: false
},
/* puppeteerCluster: {
concurrency: 'CONCURRENCY_BROWSER', // which mode to use
maxConcurrency: 1,
},*/
output: {
json: true, // output json
html: global.isDev // output html
},
debug: global.isDev, // output debug info
cache: false, // disable caching of results
scanner: {
dynamicSampling: false, // no dynamic sampling
maxRoutes: 100000, // max number of routes to scan
samples: 1, // number of samples to take, higher does not work correctly currently
crawler: false, // enable the crawler
robotsTxt: false, // don't respect robots.txt
sitemap: false, // don't respect sitemap.xml,
skipJavascript: false, // don't skip javascript
// exclude all pdfs and amp pages
/* exclude: [
'/.*?pdf',
'.*!/amp',
/!* 'en-*',*!/
],*/
// use desktop to scan
device: device,
// enable the throttling mode, good for getting more consistent results
throttle: !global.isDev,
},
chrome: {
useSystem: false // use the bundled chrome,
}
},
{
name: 'unlighthouse-provider-' + device,
});
const two_min = 2000 * 60;
const timeOut = two_min + (urls.length * two_min);
const timeout = setTimeout(() => {
console.error('Maximum Timeout reached!');
reject('Maximum Timeout reached!');
}, timeOut);
const {hooks} = unlighthouse;
// listen to the worker-finished event
hooks.hook('worker-finished', () => {
console.log('All sites for ' + device + ' tested!');
clearTimeout(timeout);
resolve();
});
console.log('starting unlighthouse for', device);
await unlighthouse.start(); // start the unlighthouse process, will not wait for it to finish, use hooks instead
});
}
System / Nuxt Info
No response
Metadata
Metadata
Assignees
Labels
No labels