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

Small enhancement to the package creation boilerplate comments could be helpful

Open bennettatoms opened this issue 1 year ago • 0 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

Just created and used my first package, and it works great but took a little longer than it needed to to get it working. Spent 15 or 20 minutes trying to debug but kept seeing the following in the console:

Error: Cannot find package '{mypackage}' Ultimately I found the helpdoc that illuminated the answer: https://learning.postman.com/docs/tests-and-scripts/write-scripts/package-library/#add-a-new-package

Which explains that, instead of this, which is what the default boilerplate comments in the new package show:

// Once exported, use this statement in your scripts to use the package.
// const myPackage = pm.require('<package_name>')

I needed this:

// Once exported, use this statement in your scripts to use the package.
// const myPackage = pm.require('@<team_name>/<package_name>')

Just feedback on a small improvement that could save people time and help adopt the feature.

Steps To Reproduce

  1. Go to Package Library
  2. Create New Package
  3. Boilerplate code comments appear in the code editor

Screenshots or Videos

No response

Operating System

macOS

Postman Version

11.11.1

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

No response

bennettatoms avatar Sep 12 '24 18:09 bennettatoms