JSX error appearing in angular html files

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.

<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?

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

Hey there.

I’ve flagged this for attention.

1 Like

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 to track this. You can expect a fix in the next release.

Cheers,
Victor

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.

Cheers,
Victor

1 Like