puppeteer: [Bug]: Error message: failed loading configuration file
Bug expectation
Expectation : to work fine without errors
What actually happened:
I got this error
[1] [19:02:44] E/configParser - Error code: 105
[1] [19:02:44] E/configParser - Error message: failed loading configuration file projects/examples-e2e/protractor-ci.conf.js
[1] [19:02:44] E/configParser - /opt/actions-runner/_work/portal/portal/packages/sugar-engine/node_modules/puppeteer-core/lib/cjs/puppeteer/common/util.js:403
[1] callPuppeteer.args ??= new Map();
[1] ^^^
[1]
[1] SyntaxError: Unexpected token '??='
[1] at wrapSafe (internal/modules/cjs/loader.js:1029:16)
[1] at Module._compile (internal/modules/cjs/loader.js:1078:[27](https://github.tools.sap/coresystemsFSM/portal/runs/8712421?check_suite_focus=true#step:8:28))
[1] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
[1] at Module.load (internal/modules/cjs/loader.js:979:32)
[1] at Function.Module._load (internal/modules/cjs/loader.js:819:12)
[1] at Module.require (internal/modules/cjs/loader.js:1003:19)
[1] at require (internal/modules/cjs/helpers.js:107:18)
[1] at Object.<anonymous> (/opt/actions-runner/_work/portal/portal/packages/sugar-engine/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPRequest.js:18:19)
[1] at Module._compile (internal/modules/cjs/loader.js:1114:14)
[1] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
[1] protractor projects/examples-e2e/protractor-ci.conf.js exited with code 105
Bug behavior
- Flaky
Minimal, reproducible example
nothing to add
Error string
[1] [19:02:44] E/configParser - Error message: failed loading configuration file projects/examples-e2e/protractor-ci.conf.js
Puppeteer configuration
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
const puppeteer = require('puppeteer');
const execSync = require('child_process').execSync;
exports.config = {
allScriptsTimeout: 70000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
args: ["--no-sandbox", "--headless", "--disable-dev-shm-usage", "--disable-gpu", "--window-size=1280,960"],
binary: puppeteer.executablePath(),
}
},
directConnect: true,
baseUrl: 'http://localhost:4200/index.html#/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 120000,
print: function () { }
},
logLevel: 'INFO', // 'ERROR'|'WARN'|'INFO'|'DEBUG';
beforeLaunch: () => {
// ensure webdriver and chromium are in sync
console.log('[INFO]' + '='.repeat(99));
const binary = puppeteer.executablePath();
console.log('[INFO] using binary ->', binary);
// Out-commenting logic to update chrome because GHA has recently some issues with it
// const chromeVersion = execSync(`${binary} --version`, { encoding: 'utf8' }).replace('Chromium ', '');
// console.log('[INFO] Installed Chromium', chromeVersion);
// console.log(`[INFO] Setting webdriver to ${chromeVersion}`);
// console.log(execSync(`./node_modules/protractor/bin/webdriver-manager update --versions.chrome=${chromeVersion}`, { encoding: 'utf8' }));
console.log('[DONE]' + '='.repeat(99));
},
onPrepare() {
console.log('='.repeat(99));
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
Puppeteer version
20.5.0
Node version
v18.16.0
Package manager
npm
Package manager version
9.5.1
Operating system
macOS
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 24
Node 14 is not supported.
@OrKoN you are right, only 16x, 18x, 20x are supported. I hope someone finds this. My solution was downgrading the Puppeteer version to 19.4.0, which will work with node 14.
“puppeteer”: “20.0.0”,
setting the version in package.json to 20 and not ‘^20’ worked for me
Downgrading from 20.9.0 to 20.0.0 solved the issues for me. Thanks