You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its a 2 years old issue with still no fix from Angular team. Since that issue has been closed, I am creating a new issue.
When we set "bundleDependencies": "all", in angular.json file, which we normally do for SSR/Universal apps (specifically for .net/.net core applications its required), and also have "optimization": true,. The generated bundle throws below error:
NodeInvocationException: StaticInjectorError(AppServerModule)[InjectionToken Application Initializer -> InjectionToken DocumentToken]:
StaticInjectorError(Platform: core)[InjectionToken Application Initializer -> InjectionToken DocumentToken]:
Right-hand side of 'instanceof' is not an object
TypeError: StaticInjectorError(AppServerModule)[InjectionToken Application Initializer -> InjectionToken DocumentToken]:
StaticInjectorError(Platform: core)[InjectionToken Application Initializer -> InjectionToken DocumentToken]:
Right-hand side of 'instanceof' is not an object
I believe the reason of this is the compress and mangle option of terser plugin.
If we set --keep-fnames for terser plugin for server bundles or when using "bundleDependencies": "all", this issue can be resolved.
--keep-fnames Do not mangle/drop function names. Useful for code relying on Function.prototype.name.
I have verified this and it works as mentioned here #8616 (comment)
The text was updated successfully, but these errors were encountered:
🐞 Bug report
This is about the issue reported at #8616 .
Its a 2 years old issue with still no fix from Angular team. Since that issue has been closed, I am creating a new issue.
When we set
"bundleDependencies": "all",
inangular.json
file, which we normally do for SSR/Universal apps (specifically for .net/.net core applications its required), and also have"optimization": true,
. The generated bundle throws below error:I believe the reason of this is the compress and mangle option of
terser
plugin.If we set
--keep-fnames
forterser
plugin for server bundles or when using"bundleDependencies": "all"
, this issue can be resolved.I have verified this and it works as mentioned here #8616 (comment)
The text was updated successfully, but these errors were encountered: