protractor-perf
protractor-perf copied to clipboard
ConfigParser is not a constructor
I just installed this library today and ran into a problem with Protractor 4.0.9. When I tried to run protractor-perf
it was throwing the error
C:\**\npm\node_modules\protractor-perf\lib\cli.js:146
var configParser = new ConfigParser();
^
TypeError: ConfigParser is not a constructor
I changed line 145 in cli.js from var ConfigParser = require('protractor/built/configParser').default;
to var ConfigParser = require('protractor/built/configParser').ConfigParser;
It started running for me after I made this change. Should I have to do this to get it to work? Am I missing something else? Or is it just a breaking change with ptor 4+?
@afterbangx Can you send in a PR with this ? @jahnavi310 also has this issue. @jahnavi310 are you aware of this change ?
Sure thing. I'll send it in a bit.
I am still getting this error . usr/local/lib/node_modules/protractor-perf/lib/cli.js:146 var configParser = new ConfigParser(); ^ TypeError: ConfigParser is not a constructor
protractor --version Version 4.0.11
protractor-perf --version Version 0.2.2
I see this error too.
PATH_TO_MY_PROJECT/node_modules/protractor-perf/lib/cli.js:146 var configParser = new ConfigParser(); ^ TypeError: ConfigParser is not a constructor
"protractor": "^4.0.13" "protractor-perf": "^0.2.2"
Thanks for identifying the issue, this solved for me.
My versions are: "protractor": "^4.0.13", "protractor-perf": "^0.2.2"
@axemclion do you intend to add it to the new version? Is there any pending issue regarding this?
I thought about keeping compatibility with old versions:
var reqConfigParser = require('protractor/built/configParser');
var ConfigParser = reqConfigParser.default || reqConfigParser.ConfigParser;
Henrique.
@henriquelbsouza I do want to add it to the new issue. Can you send in a PR and I can merge it in and publish a new version ?
@axemclion sure, give me a moment.
@axemclion this is created, I wasn't able to run npm test
task, is this working as intended?
Just make sure that my changes didn't broke anything :P
Thanks for the fast answer by the way ;)
@henriquelbsouza The npm tests require saucelabs credentials, so they only run on master unfortunately. I merged in the PR - thanks a lot for the work !!
@axemclion @henriquelbsouza , I am trying to execute via grunt task and getting the below error. Warning: Cannot find module 'protractor/lib/configParser'. Any idea on this?
protractor: 5.1.1 protractor-perf: 0.2.3