title: "TypeError: Cannot read property 'sigBytes' of undefined" error in pre-request CryptoJS script
body: <p>I'm getting &quot;TypeError: Cannot read property 'sigBytes' of undefined&quot; error when running a postman collection with a cryptojs pre-request script. The pre-request script computes a hmac-sha256 signature which is also part of parameters of the main API to be called.</p>
  <p>Below is my script:</p>
  <pre><code>let mobile = pm.environment.get('mobileNumber');
  let value = pm.environment.get('value');
  let merchantId = pm.environment.get('merchantId');
  let referenceNumber = pm.environment.get('referenceNumber');
  let authCode = pm.environment.get('authCode');
  let secretKey = pm.environment.get('secretKey');
  
  let string = mobile + value + merchantId + referenceNumber + authCode;
  
  pm.environment.set('string', string);
  
  let hmac = CryptoJS.HmacSHA256(string, secretKey);
  
  pm.environment.set('hmac', hmac);
  
  signature = &quot;hmac256-&quot; + hmac;
  
  pm.environment.set('signature', signature);
  </code></pre>
  <p>I already tried encoding the string and secretKey to UTF-8, base64stringify, JSON stringify but I'm getting errors still.</p>
  <p>Here are sample values from each of the variables:</p>
  <ul>
  <li>mobile - +639012345678</li>
  <li>value - 100</li>
  <li>merchantId - TEST_MERCHANT1</li>
  <li>referenceNumber - TEST_MERCHANT1-000001</li>
  <li>authCode - 000001</li>
  <li>secretKey - a2c36909-c9cc-4ed3-9423-ec170e1eb6c2</li>
  </ul>