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

Automatic Angular CLI configuration error: The "path" argument must be of type string. Received type undefined #2305

Closed
manudss opened this issue Jan 6, 2020 · 9 comments

Comments

@manudss
Copy link

manudss commented Jan 6, 2020

Issue description or question

When first trying to use wallby.js with angular project with automatic configuration on intellj IDEA 2019.3. I did not succeed to run wallaby on my project.

Wallaby diagnostics report

The "path" argument must be of type string. Received type undefined

wallaby.js started
core v1.0.807
Failed to load configuration file: Automatic Angular CLI configuration error: The "path" argument must be of type string. Received type undefined

We've also tried to automatically configure Wallaby.js for other frameworks
Automatic Jest configuration error: Module jest-cli is not found in 'C:\Users\emmanuel\dev\wam_front_end\src'.

Angular version :

"@angular-devkit/build-angular": "~0.803.21",
"@angular-devkit/build-ng-packagr": "~0.803.21",
"@angular/cli": "^8.3.21",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^8.2.14",
"@angular/animations": "^8.2.14",
"@angular/cdk": "^8.2.3",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/material": "^8.2.3",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@angular/router": "^8.2.14",
"wallaby-webpack": "^3.9.15"

@ArtemGovorov
Copy link
Member

Can you please provide a full Wallaby diagnostics report as described below:

  • start Wallaby in your project;
  • wait until it reports some results (finishes running tests);
  • use Wallaby Help | Wallaby.js | Copy Diagnostics Report menu item;
  • paste generated report from your clipboard below (feel free to review and edit the report if required).

@ArtemGovorov
Copy link
Member

Also, from the error message it looks like you are trying to start Wallaby in src subfolder of your project. Please try selecting Root path in your Wallaby Run Configuration in IntelliJ to point to your project's root (C:\Users\emmanuel\dev\wam_front_end) instead.

@manudss
Copy link
Author

manudss commented Jan 7, 2020

Thanks for answer.

Can you please provide a full Wallaby diagnostics report as described below:

  • start Wallaby in your project;
  • wait until it reports some results (finishes running tests);
  • use Wallaby Help | Wallaby.js | Copy Diagnostics Report menu item;
  • paste generated report from your clipboard below (feel free to review and edit the report if required).
    It was what as already done, and The diagnostics was only this :
    The "path" argument must be of type string. Received type undefined

Also, from the error message it looks like you are trying to start Wallaby in src subfolder of your project. Please try selecting Root path in your Wallaby Run Configuration in IntelliJ to point to your project's root (C:\Users\emmanuel\dev\wam_front_end) instead.

This is a particularity of our project, all the angular code is under the a src folder. Else wallaby will not detect that it was angular. It will just try Automatic Jest Configuration.

The "path" argument must be of type string. Received type undefined
Do you know what this path refere to ? It is from a tsconfig ? Angular.json ? or from wallaby.js ?

@ArtemGovorov
Copy link
Member

Do you know what this path refere to ? It is from a tsconfig ? Angular.json ? or from wallaby.js ?

It looks like it's referring to some Wallaby internal code.

Can you please provide a full Wallaby diagnostics report as described in my response above? If you don't want to post it here, you may send it to hello@wallabyjs.com.

@manudss
Copy link
Author

manudss commented Jan 7, 2020

@ArtemGovorov Is there another way to get this reports ? Because when I do this, I get nothing from intellj

@smcenlly
Copy link
Member

smcenlly commented Jan 7, 2020

We have added some additional logging that should help us identify the cause of the problem. Could you please ensure that Wallaby is updated to the latest version of core, v1.0.808 (this appears at the top of your diagnostic report). If Wallaby does not update automatically for you, you may force a core update by closing all instances of your editor and then restarting your editor and then starting wallaby.js.

After you have updated Wallaby core, please create a wallaby configuration file as shown below:

module.exports = () => {
  return {
    autoDetect: true,
    trace: true
  }
}

After creating the configuration file, please update your run configuration to point to the configuration file instead of using automatic configuration, and then start Wallaby and provide us with the output of your Wallaby Console window.

@manudss
Copy link
Author

manudss commented Jan 8, 2020

Sent the rapport by mail.

@NikGovorov
Copy link
Member

Thanks for reporting the issue. It is fixed and the fix is published in the latest core version.

The issue was that Wallaby.js required sourceRoot property existing in angular.json, now it's optional with default fallback to src.

@manudss
Copy link
Author

manudss commented Jan 9, 2020

Thanks, it is working now.

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

No branches or pull requests

4 participants