brandonroberts / angular-router-loader

A Webpack loader that enables string-based module loading with the Angular Router

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TS7006: Parameter 'e' implicitly has an 'any' type.

ClaytonHunt opened this issue · comments

In version 0.8.3 of this package, a change was made to line 39 of the utils.js file.

() => { throw({ loadChunkError: true }); }

was changed to:

e => { throw({ loadChunkError: true, details: e }); }

I appreciate the intent of the modification, however, it is causing our tslint checks to fail with the error:

TS7006: Parameter 'e' implicitly has an 'any' type.

I'm not sure how we can resolve the problem we are seeing while maintaining the error reporting capabilities that you added. I'm open to some discussion about it and would even be willing to do any of the work that is needed to make a fix. Including validating it on our code.

Thank you for taking the time to review this issue report and for helping us in getting it resolved,
Clayton Hunt

Upon a little further inspection, I see that the code in question is a string. I am going to make a small modification and submit a PR. Still open to discussion and would love for you to review the PR once submitted.

Again, Thanks for your time and development effort on this loader.
Clayton Hunt

Can confirm - I just encountered this issue after updating.

Edit: I did a bulk upgrade of packages and going back down to 0.8.2 does not resolve the issue. While the fix may work, I suspect other packages may be responsible for the error.

I had to delete node_modules and package-lock.json as well as removing the '^' from my package.json to get the downgrade fix to work locally.

I still have this issue with 0.8.3

TS7006: Parameter 'e' implicitly has an 'any' type.

Will this be fixed, maybe version 0.8.4?

Greetins Damien

I encounter the same "TS7006: Parameter 'e' implicitly has an 'any' type." error on "loadChildren" attribute specified on the route as follows:

 import { NgModule } from '@angular/core';
 import { Routes, RouterModule } from '@angular/router';

 const routes: Routes = [
     {
         path: 'counter', 
         loadChildren: './components/counter/counter.module#CounterModule'
     },
      ...
 ];

 @NgModule( {
     imports: [RouterModule.forRoot( routes )],
     exports: [RouterModule]
 } )
 export class AppRoutingModule {}

Where would I look for the "e" parameter to define it as (e: any)? :-\

This fix has been published as 0.8.4