postman-app-support icon indicating copy to clipboard operation
postman-app-support copied to clipboard

Fixing "Using "CryptoJS" is deprecated. Use "require('crypto-js')" instead." console warning results in breaking newman test run

Open avostretsov opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the tracker for existing similar issues and I know that duplicates will be closed

Describe the Issue

Post V11 release I started seeing various warnings in the Postman app console. This is the last one I am having trouble resolving: Using "CryptoJS" is deprecated. Use "require('crypto-js')" instead.

Steps To Reproduce

  1. Have Postman upgraded to V11+
  2. Use CriptoJs package to decode jwt in the Scripts
  3. Run the test in Postman with console open Notice how Postman console throws the following warning: Using "CryptoJS" is deprecated. Use "require('crypto-js')" instead.
  4. Get the warning silenced by defining CryptoJS const CryptoJS = require('crypto-js')
  5. Re-run the test in Postman app Notice how CriptoJS warning is no longer showing
  6. Run the same Postman collection with newman

Expected Outcome: newman test rune completes without errors

Actual Outcome: newman test run results in the following error: Identifier 'CryptoJS' has already been declared at test-script inside [Call Name]

Screenshots or Videos

No response

Operating System

macOS

Postman Version

11.8.1

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

Newman version 6.2.1

avostretsov avatar Aug 29 '24 18:08 avostretsov