Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigParser is not a constructor #41

Open
afterbangx opened this issue Oct 27, 2016 · 10 comments
Open

ConfigParser is not a constructor #41

afterbangx opened this issue Oct 27, 2016 · 10 comments

Comments

@afterbangx
Copy link
Contributor

afterbangx commented Oct 27, 2016

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+?

@axemclion
Copy link
Owner

@afterbangx Can you send in a PR with this ? @jahnavi310 also has this issue. @jahnavi310 are you aware of this change ?

@afterbangx
Copy link
Contributor Author

Sure thing. I'll send it in a bit.

axemclion pushed a commit that referenced this issue Nov 30, 2016
* fix for ConfigParser is not a constructor error
supports protractor 4.x.x

* fix for #41 ConfigParser is not a constructor error
@deepu105045
Copy link

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

@linwenting
Copy link

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"

@henriquelbsouza
Copy link
Contributor

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.

@axemclion
Copy link
Owner

@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 ?

@henriquelbsouza
Copy link
Contributor

@axemclion sure, give me a moment.

@henriquelbsouza
Copy link
Contributor

@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 ;)

@axemclion
Copy link
Owner

@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 !!

@raghulraj
Copy link

raghulraj commented Feb 20, 2017

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants