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

LocalizeRouterModule.forRoot returns a ModuleWithProviders type without a generic type argument #172

Open
chiqui3d opened this issue Jan 26, 2020 · 20 comments

Comments

@chiqui3d
Copy link

I'm submitting a ...

[x] bug report => Search github for a similar issue or PR before submitting

Full Error

  ERROR in node_modules/localize-router/src/localize-router.module.d.ts:33:68 - error NG6005: LocalizeRouterModule.forRoot returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument
to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.
    
    33     static forRoot(routes: Routes, config?: LocalizeRouterConfig): ModuleWithProviders;
                                                                          ~~~~~~~~~~~~~~~~~~~
    src/app/app-routing.module.ts:40:14 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class
    
    40 export class AppRoutingModule {}

🌍 Your Environment

Angular Version:


~9.0.0-rc.8

Localize Router Version:


"localize-router": "^2.0.0-RC.3",
"localize-router-http-loader": "^1.0.2",

app-routing.module.ts


import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import {HomeComponent} from './page/home/home.component';
import {ContactComponent} from './page/contact/contact.component';
import {TranslateService} from '@ngx-translate/core';
import {HttpClient} from '@angular/common/http';
import { Location } from '@angular/common';
import {LocalizeParser, LocalizeRouterModule, LocalizeRouterSettings} from 'localize-router';
import {LocalizeRouterHttpLoader} from 'localize-router-http-loader';

export function HttpLoaderFactory(translate: TranslateService, location: Location, settings: LocalizeRouterSettings, http: HttpClient) {
  return new LocalizeRouterHttpLoader(translate, location, settings, http);
}

const routes: Routes = [
  {
    path: '',
    pathMatch: 'full',
    component: HomeComponent
  },
  {
    path: 'contact',
    component: ContactComponent
  }
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes),
    LocalizeRouterModule.forRoot(routes, {
      parser: {
        provide: LocalizeParser,
        useFactory: HttpLoaderFactory,
        deps: [TranslateService, Location, LocalizeRouterSettings, HttpClient]
      }
    })
  ],
  exports: [ RouterModule, LocalizeRouterModule ]
})
export class AppRoutingModule {}


@Bozonych
Copy link

I have the same problem

@materazu
Copy link

Same here

2 similar comments
@ghost
Copy link

ghost commented Mar 2, 2020

Same here

@skyquartam
Copy link

Same here

@ottodranik
Copy link

ottodranik commented Mar 12, 2020

Can someone fix it for a compatibility with INY and Angular 9?

Here is a PR about that #174

Maybe it needed to fix the yaml file for CI and replace node v8 with node v12 to make this PR successful?

@marcgeurts
Copy link

Same here

@sleepychaman
Copy link

same here

1 similar comment
@mehmetatacan
Copy link

same here

@elvenbyte
Copy link

please, solv this asap, can't go on :-(

@fess-v
Copy link

fess-v commented Mar 25, 2020

Just disable ivy in tsconfig.app.json (and in tsconfig.server.json if you use Angular Universal)
"angularCompilerOptions": { "enableIvy": false },
Not all the main libraries already support Ivy, so the only solution to disable it
Hope, it helps

@gilsdav
Copy link

gilsdav commented Mar 25, 2020

Or use fork that is compatible with Angular 9
https://github.com/gilsdav/ngx-translate-router

@elvenbyte
Copy link

Just disable ivy in tsconfig.app.json (and in tsconfig.server.json if you use Angular Universal)
"angularCompilerOptions": { "enableIvy": false },
Not all the main libraries already support Ivy, so the only solution to disable it
Hope, it helps

Thanx a lot, but it doesn't help. I'm working with iv class, so I need to use Ivy, 'cause I'm working with an already done project, but thanks anyway.

@elvenbyte
Copy link

Or use fork that is compatible with Angular 9
https://github.com/gilsdav/ngx-translate-router

It didn't work either, even installing version 3, recommended for angular 8/9.

@elvenbyte
Copy link

Can someone fix it for a compatibility with INY and Angular 9?

Here is a PR about that #174

Maybe it needed to fix the yaml file for CI and replace node v8 with node v12 to make this PR successful?

I supposed we must wait for it. It should be ready in some days, I hope.

@gilsdav
Copy link

gilsdav commented Mar 26, 2020

@elvenbyte I have no known issues with Angular 9 (official release, not RC) and node 12.
You can check that my demo have Ivy enabled.
What type of errors do you have ?

@elvenbyte
Copy link

@elvenbyte I have no known issues with Angular 9 (official release, not RC) and node 12.
You can check that my demo have Ivy enabled.
What type of errors do you have ?

ERROR in node_modules/localize-router/src/localize-router.module.d.ts:33:68 - error NG6005: LocalizeRouterModule.forRoot returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument
to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.

@saharati
Copy link

saharati commented Apr 9, 2020

Any news?

@chiqui3d
Copy link
Author

chiqui3d commented Apr 9, 2020

I have migrated to Nextjs https://github.com/zeit/next.js/

@clk0115
Copy link

clk0115 commented Jul 4, 2020

Please check this https://github.com/gilsdav/ngx-translate-router. it may help.

@tycoonm
Copy link

tycoonm commented Dec 12, 2020

Looks like the project is dead. There are no release since January.

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