# Angular 8+: Duplicate Method Reporting

### Problem <a href="#problem" id="problem"></a>

When scanning code generated by Angular 8 (or greater), almost all the methods reported more than once to sealights causing lower coverage and more quality risks.

### Cause <a href="#cause" id="cause"></a>

Angular 8 changed its defaults and generates multiple bundled versions of the code like, for example, `esm5`, `esm2015`, etc.\
They are essentially the same code just in a different format, and then along with the source maps point back to the same code in the original source files.\
This in turn creates duplicate entries in Sealights as they are scanned and reported.

### Solutions <a href="#solutions" id="solutions"></a>

#### Change the Angular 8 configuration to generate only 1 type <a href="#change-the-angular-8-configuration-to-generate-only-1-type" id="change-the-angular-8-configuration-to-generate-only-1-type"></a>

This can be done for instance by updating the `browserslist` value in your configuration.

#### Update the .slignore file to ignore all the files you don't want <a href="#update-the-.slignore-file-to-ignore-all-the-files-you-dont-want" id="update-the-.slignore-file-to-ignore-all-the-files-you-dont-want"></a>

Setting the `.slignore` with something similar to the following, depending on the structure of the folders and files:

{% code overflow="wrap" lineNumbers="true" %}

```
**/esm2015
*-es2015.*
```

{% endcode %}

More details are available in our dedicated article: [Ignoring Files or Folders](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/ignoring-files-or-folders.md)

#### When you want to deploy more than one type <a href="#when-you-want-to-deploy-more-than-one-type" id="when-you-want-to-deploy-more-than-one-type"></a>

If you want to deploy more than one type which means you need the Sealights agent to instrument more than one, then you will need to split the build scan and instrumentation commands.

* For scanning the code, you will not use the `--instrumentForBrowsers` option, as in: [Scanning a Build](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/backend-server-application/scanning-a-build.md)\
  This should be done on only one of the folders.
* For instrumenting the code, you will use the `--instrumentForBrowsers` as in [Front-End App: Scan & Instrument](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/front-end-application/front-end-app-scan-and-instrument.md), but you will also specify the `--instrumentationOnly` flag so that a new build scan will not be performed. This should be done on all the folders you want to deploy and capture coverage for.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/troubleshooting-faq/node-javascript/angular-8+-duplicate-method-reporting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
