vision10 / mssql-ssrs

Promise based api for MSSQL Reporting Services with ntlm, basic, custom security
23 stars 6 forks source link

bundle build issue using esbuild #22

Closed trevor-sutherland closed 1 year ago

trevor-sutherland commented 1 year ago

Problem re-assign const

in reportService.js

async setItemDataSources(itemPath, dataSources) {
        try {
            const ds = [];
            if (Array.isArray(dataSources)) {
                ds = dataSources;
            } else {
                for (var key in dataSources)
                    ds.push({ Name: key, DataSourceReference: { Reference: dataSources[key] } });
            }
            const result = await this.client.SetItemDataSourcesAsync({
                ItemPath: itemPath,
                DataSources: { DataSource: ds }
            });
            return result[0];
        } catch (error) { utils.errorHandler(error) }
    }

Error when compiling using ESBuild

X [ERROR] Cannot assign to "ds" because it is a constant

node_modules/mssql-ssrs/lib/reportService.js:197:16:
  197 │                 ds = dataSources;
      ╵                 ~~

The symbol "ds" was declared a constant here:

node_modules/mssql-ssrs/lib/reportService.js:195:18:
  195 │             const ds = [];
trevor-sutherland commented 1 year ago

Pull request #23