Solvedangular cli ERROR in Cannot use 'in' operator to search for 'providers' in null
✔️Accepted Answer
@raviganesh12 change export default RouterModule.forRoot(routes);
to
export const Routing = RouterModule.forRoot(routes);
And your imports for your routing on your app.module.ts needs to be changed too.
And see if that works for you.
Other Answers:
@penleychan @clydin I still experience the same issue, I definitely don't use 'default' infront of my classes and the main issue is that I don't even get an indicator as to what file is causing this.
Could we kindly re-open the issue?
Hi,
I upgraded to angular-cli@1.0.0-beta.25.5 and am receiving the same error as discussed above. I have followed the above instructions but the error persists.
I thought it was corrected. The error still does not point to any specific file either.
Remove the keyword default
for the module routing and it works for me too.
OS?
WIndows 10 Pro
Versions.
angular-cli: 1.0.0-beta.24
node: 6.3.1
os: win32 x64
@angular/common: 2.4.1
@angular/compiler: 2.4.1
@angular/core: 2.4.1
@angular/forms: 2.4.1
@angular/http: 2.4.1
@angular/platform-browser: 2.4.1
@angular/platform-browser-dynamic: 2.4.1
@angular/router: 3.4.1
@angular/compiler-cli: 2.4.1
Repro steps.
Brand new project created with CLI version beta 24. Adding module loading via routing loadChildren
The log given by the failure.
ERROR in Cannot use 'in' operator to search for 'providers' in null
Mention any other details that might be useful.
Issues appears when using lazy loading, for example I have HomeModule, if I were to import that to app.module.ts, and have my routing configured as:
app.routing.ts
app.module.ts
Then the ERROR in Cannot use 'in' operator to search for 'providers' in null appears.