1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular Universal SSR build fails: "this.debug is not a function" during index.html generation

Discussão em 'Angular' iniciado por Zeshan Saqib, Julho 15, 2025.

  1. Zeshan Saqib

    Zeshan Saqib Guest

    I'm working on an Angular Universal (SSR) project using @angular/cli, and during the SSR build process, I get the following error:

    × Index html generation failed.
    this.debug is not a function


    The browser build completes successfully:

    √ Browser application bundle generation complete.

    But it fails during the server-side rendering phase.

    What I’ve Tried

    • Searched my codebase for this.debug() — nothing found.
    • Using the default Angular builder: @angular-devkit/build-angular:browser
    • I am using SSR with @nguniversal/express-engine
    • Here’s a snippet of my server.ts:

    const domino = require('domino');
    const fs = require('fs');
    const path = require('path');
    const template = fs.readFileSync(path.join(process.cwd(), 'dist/browser/index.html')).toString();
    const win = domino.createWindow(template);
    global['window'] = win;
    global['document'] = win.document;


    There is no direct call to this.debug() in my code. So I suspect a third-party dependency or library might be trying to access window.debug() assuming it’s a function.

    Continue reading...

Compartilhe esta Página