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

Unhandled promise rejection #167

Open
BruneXX opened this issue Sep 12, 2019 · 6 comments
Open

Unhandled promise rejection #167

BruneXX opened this issue Sep 12, 2019 · 6 comments

Comments

@BruneXX
Copy link

BruneXX commented Sep 12, 2019

I'm submitting a ... (check one with "x")

[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if similar feature request does not exist
[ ] support request => Suggested place for help and support is [stackoverflow](https://stackoverflow.com/), search for similar question before posting

Description

I've downloaded the demo of localized-router to check the configuration, I've reviewed a lot and after my configuration I'm receiving this error:

zone-evergreen.js:659 Unhandled Promise rejection: Class constructor SystemJsNgModuleLoader cannot be invoked without 'new' ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Class constructor SystemJsNgModuleLoader cannot be invoked without 'new'
    at new LocalizeRouterConfigLoader (localize-router-config-loader.js:22)

I saw that in demo you're using angular 6 could this be an issue related to angular 8? thanks

🌍 Your Environment

Angular Version: 8.2.5

Localize Router Version:
2.0.0-RC.3

@BruneXX BruneXX changed the title Unhandled promise Unhandled promise rejection Sep 12, 2019
@BruneXX
Copy link
Author

BruneXX commented Sep 13, 2019

Hi new update:

I've managed to solve this, but now I'm experiencing no errors on compílation, but when I'm trying to access to the app I'm receiving the following error in the node console..

ERROR [Error]

So that's all.. there's no error description just that, any ideas what can be happening here?

@BruneXX
Copy link
Author

BruneXX commented Sep 13, 2019

well, I went a little further and found that it seems to be a problem with createTranslateLoader funciton but I'm not 100% sure, I've reviewed an old angular repo https://github.com/gilsdav/angular-universal-localize-router

and there's seems to be using a ManualParserLoader that apparently works.. so at least the app is up and running using that loader instead of the createTranslateLoader

If someone have a clue on this will be really appreciated since the localize-router documentation is not so clear how should be implemented in the universal apps..

@Tyranwyn
Copy link

I'm having the same problem when accessing localhost:4200.

TypeError: Class constructor SystemJsNgModuleLoader cannot be invoked without 'new'
at new LocalizeRouterConfigLoader (:4200/vendor.js:176186)
at createClass (:4200/vendor.js:91249)
at createProviderInstance (:4200/vendor.js:91210)
at initNgModule (:4200/vendor.js:91116)
at new NgModuleRef
(:4200/vendor.js:92226)
at createNgModuleRef (:4200/vendor.js:92209)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (:4200/vendor.js:104419)
at NgModuleFactory
.create (:4200/vendor.js:105552)
at :4200/vendor.js:100252
at ZoneDelegate.invoke (:4200/polyfills.js:10931)

LocalizeRouterModule.forRoot(routes, {
      parser: {
        provide: LocalizeParser,
        useFactory: (translate, location, settings, http) =>
          new LocalizeRouterHttpLoader(translate, location, settings, http),
        deps: [TranslateService, Location, LocalizeRouterSettings, HttpClient]
      }
    })

@Tyranwyn
Copy link

Tyranwyn commented Sep 26, 2019

so, changing tsconfig.json target from esnext to es5 and module to es2015 fixed it for me.

@BruneXX
Copy link
Author

BruneXX commented Sep 26, 2019

Hi @Tyranwyn are you using Angular Universal too?

@Tyranwyn
Copy link

Tyranwyn commented Oct 2, 2019

No I am not

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

2 participants