Giter Site home page Giter Site logo

Ability to disable "NG3: The containing function or module body is too large for control flow analysis. [plugin angular-compiler]" rule about angular HOT 6 OPEN

mitat-koyuncu-work avatar mitat-koyuncu-work commented on April 27, 2024
Ability to disable "NG3: The containing function or module body is too large for control flow analysis. [plugin angular-compiler]" rule

from angular.

Comments (6)

alxhub avatar alxhub commented on April 27, 2024

That error is a TypeScript compiler error, not an Angular error specifically (the fact that it shows up as NG3 is a little surprising...). It's TypeScript complaining that one of the functions in the code is too big/branchy to be analyzed for type narrowing.

Probably the code in question is not one of your own functions, but a component template (which gets translated to a function for type-checking). If a template has too many branches, it can trigger this error.

We'll need a working reproduction to further diagnose the problem and determine if it's due to an excessively large template or perhaps a bug that's causing excessive branching in the type-check block.

from angular.

mitat-koyuncu-work avatar mitat-koyuncu-work commented on April 27, 2024

The component that throws error is around 5000 lines and html template file is over 3000 lines . I don't think i can just copy the file because of dependencies it would fail but i will try to create a component without that dependencies with same error.

When updating to Angular 17 we migrated to new build system via "ng update @angular/cli --name use-application-builder" command. I don't know if error has any connection with this change.

I did a research about error message and found it related to TS2563 typescript error. But i didn't find a way to disable it through tsconfig.json file.

Thanks

from angular.

mitat-koyuncu-work avatar mitat-koyuncu-work commented on April 27, 2024

I created a stackblitz about this error here: link

I noticed in stackblitz i am getting a different error but i think it is related with NG3 error:

✘ [ERROR] Maximum call stack size exceeded [plugin angular-compiler]

  This error came from the "onStart" callback registered here:

    node_modules/@angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin.js:81:18:
      81 │             build.onStart(async () => {
         ╵                   ~~~~~~~

    at setup (/home/projects/stackblitz-starters-sl7l8v/node_modules/@angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin.js:81:19)
    at async handlePlugins (/home/projects/stackblitz-starters-sl7l8v/node_modules/esbuild/lib/main.js:1330:9)

I hope this helps.

from angular.

byturkak avatar byturkak commented on April 27, 2024

I have the same problem and don't know why either.. Do you solve it?

from angular.

alxhub avatar alxhub commented on April 27, 2024

We would still need a working reproduction of this issue in order to investigate.

from angular.

mitat-koyuncu-work avatar mitat-koyuncu-work commented on April 27, 2024

@alxhub I created a stackblitz here: link

I know stackblitz doesn't have same error but in vscode same code gives ng3 error. If this is not enough let me know what i can provide to you.

Thanks

from angular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.