Production build error

Hi,
my Angluar/.net core 2.x- Application does not build in production mode with 2.61.4.
I can run the app in development, but production build failed with "src\app\main-layout\main-layout.component.html(64,26): : Property 'window' does not exist on type 'MainLayoutComponent'."
Any suggestions,
Thanks,
Ralf

Hi @Ralf,

Can you check if you have any custom code in the MainLayout? This error is not related to the Radzen version most probably.

Hi,
I found the problem. In main layout I use a navigation item:


This works in dev, but could not be build in prod mode.
How can I provide window.location.href to the url?
Thanks,
Ralf

Hi Ralf,

Try creating a new page property with Name href and Value window.location.href. Then use ${href}/reports for the Path of that navigation item.

Thanks. I will use the property. I wonder nevertheless why the prod build failed.

This happens because Angular uses a stricter compilation mode for production builds. The reason it is not enabled by default is that it is a lot slower than the "debug" compilation mode.