Error: Cannot find package

postman v11 update releases new package library functionality. This is a very nice feature however does not seem to work.

Postman is able to create, find and use packages alright.
image

However, on runtime; when you actually make a request. Postman returns Error: Cannot find package ‘@team-name/package-name’.

Is anyone else seeing this error?

4 Likes

Getting the same error, after following the directions exactly. It’s really strange, because it auto-completed the name of the package (in the format @my-team/my-package and the name of the function within the package. So it obviously “sees” the package during editing, but not during runtime.

4 Likes

@sgurungcassini @material-administra9 Sorry that you’re facing this issue. I would need some help to debug this. Can you share the exported collection with this request? You can remove any sensitive info from it.
Note: Packages will not be exported with the collection so you don’t have to worry about leaking that info.

You can also choose to share this with [email protected] and mention this community thread.

Hi Utkarsh Maheshwari,

I also got feedback from Postman Support. It appears Lou (postman support engineer) was able to re-produce this issue (See screenshot shared to me below).

The issue reference ID is #195965 assigned to Louis Tsiros.

As per your request, to assist with investigation. I am sending you and [email protected] a collection which re-produces this issue.

Error re-produced from the collection.

Please see postman collection attached.

(Attachment Postman Library Error.postman_collection.json is missing)

@sgurungcassini The error in this screenshot seems to be different. It seems that the function status200 is not exported from the package. Can you check if you’re exporting it?

module.exports.status200 = function () {};

Hey Utkarsh,

Apologies, I did not review the screenshot before sharing. Please see correct ones below.

Can confirm I am exporting:
module.exports = { status200 }

via: module.exports.status200 = function () {};
I see the same cannot find package error

1 Like

By the looks of things, it seems to work for me on Postman in the Browser, but not on the Desktop app.

1 Like

Thanks @fervidspider,
I can confirm via postman browser, it is able to find the package. Tested this with the Echo API.

However, I need to use the Desktop Agent for my use case where the issue is present.

I have the same error that was reported on my desktop app. But I can confirm that I don’t have the same error in the browser. So it seems needs to be provided a fix for the postman desktop app

I have the same issue on both desktop and browser. This is my library:

And this is how I reference it:

I get at runtime: Error: Cannot find package ‘@xxx/date-handling’

But the package seems to be recognized when editing.

Hey folks,

I believe there are two distinct issues surfacing on this thread. First of all, packages cannot be used within other packages at the moment. If the error message mentions something along the lines of “Error in package X: Cannot find package Y”, then this is the cause. This is something we’ll build out as an improvement as we see more adoption, and we’ll be adding clearer messaging within the app to make this clear.

Secondly, there’s the issue of packages not resolving directly within the pre-request or post-response scripts. This looks like a bug, but it’s not something everyone is encountering so we’re working on identifying the conditions which trigger it and any workarounds which may be available. For starters, if you run into this problem please try using the “Refresh results” button in the Test Results tab to see if it resolves the problem as a one-off:

We’ll continue working on finding and addressing the root cause, but in the meantime please let us know if this (admittedly, not great workaround) helps to unblock your runs.

Hi,
I my case it looks like this:

So I can not press the refresh result.

I am seeing this issue pretty much across all of the API requests I am using. I did just try to refresh the results, but this did not change anything. I am still just kind of stuck.

Same, I think “Refresh Result” will only be there for post-request, not pre-request.

I’m really excited about this new feature, but I think I’ll wait a while for the initial issues to be ironed out before I start a major refactor of all our collections.

Once it’s working properly this will be a massive improvement and remove a load of duplicated code I have from copying and pasting shared functions to each new collection I create.

1 Like

Cannot find package error is displayed . It auto-completed the name of the package
image

I belive the issue regarding not being able to locate the packages, might be related to the windows client.

Atleast 2/2 on windows in my office where unable to use the new packages, however it works on an office macbook.

1 Like

Thanks @ronnieufst, after reading your comment I tried in my company and indeed it works for mac and not windows for me as well.

1 Like

I’m also experiencing the same issue others have mentioned. I’m following the documentation verbatim. Please let us know if/when this will be fixed.

We appreciate everyone’s patience here - we are working on the fix and this will be pushed out as soon as possible.

We’ll update this thread once this is done. :pray:t2:

2 Likes