# JSX error appearing in angular html files

**URL:** <https://community.sonarsource.com/t/jsx-error-appearing-in-angular-html-files/85243>\
**Category:** SonarQube Cloud\
**Tags:** html, angular\
**Created:** [March 6, 2023, 12:24pm UTC](https://community.sonarsource.com/t/jsx-error-appearing-in-angular-html-files/85243 "2023-03-06T12:24:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philip\_Durrant](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/philip_durrant/32/42753_2.png) [@Philip\_Durrant](https://community.sonarsource.com/u/Philip_Durrant)\
**Post date:** [March 6, 2023, 12:24pm UTC](https://community.sonarsource.com/t/jsx-error-appearing-in-angular-html-files/85243/1 "2023-03-06T12:24:16Z")

</div>

Hi, I’m having an issue where I’m getting a parse error on some html files. The files themselves are all angular components.

The error I’m getting is

`##[error]ERROR: Failed to parse file [xxxxxxxxxxxxx.html] at line 19: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?`

The code that it is complaining about is some quite old fashioned, but perfectly valid angular components.

```auto
<div class="row-fluid" ng-cloak>
    <div class="span12">
        <div id="kendo-objectives-grid_{{$id}}"
             kendo-grid="vm.grid"
             k-options="vm.gridOptions"
             k-rebind="vm.gridOptions"
             class="k-grid-condensed kendo-objectives-grid" ng-cloak></div>
    </div>
</div>
<script type="text/ng-template" id="objectivesToolbarTemplate.html">
    <div>
        <div class="btn-group">
            <button ng-csv="vm.exportAsCsv()" csv-header="vm.getExportHeaders()" charset="utf-8" add-bom="true" filename="{{::vm.csvFilename}}" class="btn">CSV</button>
            <button ng-csv="vm.exportAsCsv()" csv-header="vm.getExportHeaders()" charset="utf-8" add-bom="true" filename="{{::vm.csvFilename}}" class="btn">Excel</button>
            <button ng-class="::{'disabled': !vm.canCopyClipboard}" class="btn" ng-click="vm.copyToClipboard()">Copy</button>
        </div>
    </div>
</script>
<script type="text/ng-template" id="userTemplate.html">
    <div>
        <a ng-href="/app\\#/profile/{{::dataItem.User.Id}}" ng-bind="::dataItem.User.FullName" />
    </div>
    <span ng-if="::!dataItem.User.Active">
        <br />
        <span class="label label-important">[[[Deactivated]]]</span>
    </span>
</script>

```

It looks like the parser is seeing html within the script tag and assuming that it is jsx rather than an angular component.

Is there anything I can do about this?

---

<div class="post-metadata">

**Author:** ![Philip\_Durrant](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/philip_durrant/32/42753_2.png) [@Philip\_Durrant](https://community.sonarsource.com/u/Philip_Durrant)\
**Post date:** [March 7, 2023, 9:55am UTC](https://community.sonarsource.com/t/jsx-error-appearing-in-angular-html-files/85243/2 "2023-03-07T09:55:41Z")

</div>

Just to add to this, because it is erroring out we are losing analysis after this point

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [March 7, 2023, 9:56am UTC](https://community.sonarsource.com/t/jsx-error-appearing-in-angular-html-files/85243/4 "2023-03-07T09:56:57Z")

</div>

Hey there.

I’ve flagged this for attention.

---

<div class="post-metadata">

**Author:** ![victor.diez](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/victor.diez/32/38525_2.png) [@victor.diez](https://community.sonarsource.com/u/victor.diez)\
**Post date:** [March 10, 2023, 6:24pm UTC](https://community.sonarsource.com/t/jsx-error-appearing-in-angular-html-files/85243/6 "2023-03-10T18:24:36Z")

</div>

Hello @Philip_Durrant,

thanks for reporting this. Indeed there seems to be a bug in our JS plugin for HTML files. I’ve opened a [ticket](https://github.com/SonarSource/SonarJS/issues/3757) to track this. You can expect a fix in the next release.

Cheers,  
Victor

---

<div class="post-metadata">

**Author:** ![victor.diez](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/victor.diez/32/38525_2.png) [@victor.diez](https://community.sonarsource.com/u/victor.diez)\
**Post date:** [March 10, 2023, 7:31pm UTC](https://community.sonarsource.com/t/jsx-error-appearing-in-angular-html-files/85243/11 "2023-03-10T19:31:14Z")

</div>

Hi @Philip_Durrant,

just to add that, while waiting for the fix, you may want to exclude that file so that you can have an analysis of the whole project. You can check the “File exclusion and inclusion” section at [this link](https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/).

Cheers,  
Victor
