JavaScriptServices icon indicating copy to clipboard operation
JavaScriptServices copied to clipboard

generator-aspnetcore-spa have problems with ng2-translate

Open el7lme opened this issue 9 years ago • 3 comments

when using ng2-translate in a project created using generator-aspnetcore-spa, gave me errors after searching i found that ng2-translate using [Http] and in the template we using [universal module] which is have http.

following is the error An unhandled exception occurred while processing the request.

Exception: Call to Node module failed with error: Error: Uncaught (in promise): Error: This method is not implemented in Parse5DomAdapter: getCookie Error: This method is not implemented in Parse5DomAdapter: getCookie at new Error (native) at _notImplemented (c:\Users\hamed\Documents\Visual Studio 2015\Projects\testTemplate2\ClientApp\dist\vendor.js:90933:12) [angular] at Parse5DomAdapter.module.exports.Parse5DomAdapter.getCookie (c:\Users\hamed\Documents\Visual Studio 2015\Projects\testTemplate2\ClientApp\dist\vendor.js:91528:69) [angular]

is there any solution for that.

el7lme avatar Feb 19 '17 20:02 el7lme

Sounds like ng2-translate doesn't support server-side prerendering, i.e., Angular Universal. You might want to report that to the ng2-translate maintainers.

As a workaround, you can either disable server-side prerendering, or amend your app to ensure that ng2-translate is not loaded or executed during server-side prerendering.

SteveSandersonMS avatar Feb 21 '17 15:02 SteveSandersonMS

Hi, I'm facing the same issue with ng-completer (for autocomplete).

Steve you mentioned ensuring that the module is not loaded during server-side prerendering. How would I go about doing this?

Thanks

chriscooper87 avatar Mar 20 '17 21:03 chriscooper87

I have this problem while using material design 2 - beta 2 also. Does anybody have a solution on how to not load the module in server-side?

snaikaw avatar Mar 30 '17 23:03 snaikaw