title: Cannot read property 'validate' of undefined Nodejs and React frontend
body: <p>I have a service in Nodejs which code looks like the following:</p>
  
  <pre><code>app.get('/getbackgroundPQI/:layer/:county/:year', (req, res) =&gt; {
  
  const { layer, county,year } = req.params;
  const sqc = sqlConn;
  console.log(layer,county,year)
  const layers = {
      MaintenanceTypes: "GetMaintnenanceTypeBkgLayer",
      LoadRestrictions: "GetLoadRestrictionBkgLayer",
      Ownership: "GetOwnershipBkgLayer",
      TotalSurfaceDepth: "GetTotalSurfaceDepth",
      SurfaceAge: "GetSurfaceAgeBkgLayer",
      SurfaceAgeBitu: "GetSurfaceAgeBkgLayerBit",
      SurfaceAgeConc: "GetSurfaceAgeBkgLayerConc",
      PublicImpact: "GetCurrentYearConsPublicImpact",
      PlannedImprovement: "GetPlannedImprovements",
      StructureCondition: "GetStructureConditions",
      StructureMaterial: "GetStructureMaterials",
      SurfaceType: "GetSurfaceTypeBkgLayer",
      SpecialConstructionHistory: "GetSpecialConstructionHistory",
      Age: "GetPerformanceAge",
      getPQI: "GetPerformancePQI",
      DropAge: "GetDropdownAge",
      DropPQI: "GetDropdownPQI"
  
  };
  
  const query = `
      EXEC ${layers[layer]} @county @year;
  `;
  
  const params = [sqc.paramize('county', 'year', county, year, sql.Int)];
  
  sqc.SqlSelectParamCall(
      query, params, (data) =&gt; {
         // console.log("MY Data"+data);
          //convert data
          res.send(data);
      }, true);
  });
  </code></pre>
  
  <p>My react Calling of the service looks like the following:</p>
  
  <pre><code> selectBackgroundLayerPQI = (layer, e) =&gt; {
      const county = AgencyInfo.getSelectedAgencyId();
      const year = new Date().getFullYear();
      console.log(year);
      if (layer === 'none')
      {
          this.props.clickFunctions.onLoadBackgroundLayer([]);
          this.props.clickFunctions.toggleSpecialLayer(false);
          this.legendName = '';
      }
      else {
          $.ajax({
              type: 'GET',
              url: `${config.server}\\getbackgroundPQI\\${layer}\\${county}\\${year}`,
              contentType: 'application/json',
              success: (data) =&gt; {
                  console.log(data);
                  this.props.clickFunctions.toggleSpecialLayer(false);
                  this.setState({ backgroundLegend: data[1], legendName: data[2][0].LegendName});
                  this.props.clickFunctions.onLoadBackgroundLayer(data[0]);
              },
          });
      }
  
      this.setState({ backgroundLayer: layer });
  }
  </code></pre>
  
  <p>Now if I try to hit the url of the service from browser as <a href="http://localhost:3001/getbackgroundPQI/getPQI/77/2019" rel="nofollow noreferrer">http://localhost:3001/getbackgroundPQI/getPQI/77/2019</a> my nodejs server shows the parameters which are read using req.params but however I have an error which is following:</p>
  
  <pre><code>getPQI 77 2019
  info: Sql connection started...
  error:  TypeError: Cannot read property 'validate' of undefined
  at Request.validateParameters (C:\Users\DOTSC_souroy\Desktop\PrfCat\Geographic-Roadway-Inventory-Tool-JS\grit-server\node_modules\tedious\lib\request.js:154:36)
  at Request.transformIntoExecuteSqlRpc (C:\Users\DOTSC_souroy\Desktop\PrfCat\Geographic-Roadway-Inventory-Tool-JS\grit-server\node_modules\tedious\lib\request.js:87:16)
  at Connection.execSql (C:\Users\DOTSC_souroy\Desktop\PrfCat\Geographic-Roadway-Inventory-Tool-JS\grit-server\node_modules\tedious\lib\connection.js:717:15)
  at C:\Users\DOTSC_souroy\Desktop\PrfCat\Geographic-Roadway-Inventory-Tool-JS\grit-server\node_modules\mssql\lib\tedious.js:1062:77
  at Pool.dispense [as _dispense] (C:\Users\DOTSC_souroy\Desktop\PrfCat\Geographic-Roadway-Inventory-Tool-JS\grit-server\node_modules\generic-pool\lib\generic-pool.js:310:12)
  at Pool.acquire (C:\Users\DOTSC_souroy\Desktop\PrfCat\Geographic-Roadway-Inventory-Tool-JS\grit-server\node_modules\generic-pool\lib\generic-pool.js:436:8)
  at Request._acquire (C:\Users\DOTSC_souroy\Desktop\PrfCat\Geographic-Roadway-Inventory-Tool-JS\grit-server\node_modules\mssql\lib\main.js:1185:37)
  at Request.TediousRequest.query (C:\Users\DOTSC_souroy\Desktop\PrfCat\Geographic-Roadway-Inventory-Tool-JS\grit-server\node_modules\mssql\lib\tedious.js:773:21)
  at Request._query (C:\Users\DOTSC_souroy\Desktop\PrfCat\Geographic-Roadway-Inventory-Tool-JS\grit-server\node_modules\mssql\lib\main.js:1580:54)
  at C:\Users\DOTSC_souroy\Desktop\PrfCat\Geographic-Roadway-Inventory-Tool-JS\grit-server\node_modules\mssql\lib\main.js:1540:24
  </code></pre>
  
  <p>I have mentioned both my nodejs and reactjs code just to let you know what I am doing. The reactjs function is called from a Button in frontend. I have a storedprocedure which if I execute in the database works fine and it returns me the result. 
  I will be grateful if anyone can help me with the problem.</p>