Error in package Unexpected token

hi, I am using packages and just suddenly I didn’t change a thing getting this error.

So I tried to update the Postman version it didn’t work.

Closed clean the cash still the same error.

I removed the package and imported it again with the same error, I need help! It’s blocking all my work all collections stopped working

Hey @technical-engineer16 :wave:t2:

Could you also show the package script, as that’s where the error is coming from?

hi, I found the issue one of the functions was missing ‘}’ so it broke all collections.

I think the error that Postman shows in the console is completely wrong.

Which part was completely wrong?

It was telling you that you had an issue in your script, as it was missing the }, it said that there was an unexpected ).

Where was the missing character? Was it before the )?

Currently, it’s challenging to debug scripts effectively in Postman because the error messages provided are often vague or misleading. For example, when encountering an “Unexpected token” error, the feedback pointed to unrelated issues based on the documentation and community advice.

Suggestion: To improve the developer experience, error messages should be more precise and context-specific. In this case, instead of a generic “Unexpected token” error, it would be helpful if the message identified the specific part of the script where the JSON parsing failed or where the syntax issue occurred. This would save time and reduce frustration when debugging scripts.

In the context of your particular error, I don’t believe that it’s vague or misleading:

Error in package '@team_name/package_name': Unexpected token ')'"

It’s telling you that there is a error in the named package and that there is an unexpected token in your script. This was the case because it was missing the } and instead found a ) that it wasn’t expecting.

More direct linking or visibility can be added here to zero in on the specific location (line number, etc) of your error but it sounded like you found the issue without that. I will raise this as feedback with the team though.

I think it’s debatable.

I found the issue because I know Postman but over team members were not able to do so.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.