Angular 17 website work only if development mode is on

Error: NG0507
    at fb (main-56KGYBK5.js:7:102211)
    at useValue (main-56KGYBK5.js:7:101854)
    at Pr.resolveInjectorInitializers (main-56KGYBK5.js:7:10498)
    at main-56KGYBK5.js:7:101102
    at k.invoke (polyfills-RT5I6R6G.js:1:6434)
    at Object.onInvoke (main-56KGYBK5.js:7:61757)
    at k.invoke (polyfills-RT5I6R6G.js:1:6374)
    at se.run (polyfills-RT5I6R6G.js:1:1811)
    at e.run (main-56KGYBK5.js:7:60485)
    at Qp (main-56KGYBK5.js:7:101091)

This is the error I face after deploying my angular 17 website and when ever I turn on the development mode this error gets resolved.

Hi @theutkarshjaiswal

Development mode temporarily suspends Cloudflare’s edge caching, minification and Polish features for three hours unless disabled beforehand. Development Mode allows customers to immediately observe changes to their cacheable content like images, CSS, or JavaScript.

So please try and see what products you have enabled regarding optimisation as well (Auto minify and Polish)

Hey @louise2
I have not enabled the HTML in auto minify and it started working
It is strange