Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.81k stars 1.97k forks source link

[Bug] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. #1908

Open patrickmaciel opened 4 years ago

patrickmaciel commented 4 years ago

Describe the bug

This errors occurs when I import a Postman collection with some multipart-formdata field of file type.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
at assertPath (path.js:39:11)
at basename (path.js:751:5)
at FileInputButton.render (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:60864:75)
at Qg (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236595:192)
at Og (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236594:264)
at Tg (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236602:30)
at bi (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236654:22)
at ci (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236655:284)
at Di (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236671:348)
at Yh (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236670:144)
at Xh (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236667:332)
at qf (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236665:86)
at Ji (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236675:14)
at Ki (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236675:92)
at Pi.module.exports.Pi.render (file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236683:109)
at file:///C:/Users/patri/AppData/Local/insomnia/app-7.0.6/resources/app.asar/bundle.js:236686:395

To Reproduce Steps to reproduce the behavior:

  1. Import a Postman collection with multipart-formdata endpoint + file type field
  2. Click on the endpoint
  3. See error

Expected behavior Open the endpoint without error and ignore the invalid path / reference

Screenshots image

Desktop (please complete the following information):

Additional context Nope.

lukik commented 4 years ago

Same case. Imported a collection from Postman and I get the same exact error when I click on a Request that has form data

Only way out is to Quit Insomnia as it brings up a blank pane that doesn't exit.

App Versions:

Error Image

image

Blank Pane After the above Error

image
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

TristanWiley commented 3 years ago

Same issue when trying to install a plugin, occurs on both my Mac and Linux machine. Works on my Windows machine

valdineifer commented 1 year ago

I also got a similar message when I try to "Copy as cURL":

The "path" argument must be of type string. Received an instance of Array

image

The similarities continue once that I also have my Insomnia project created by a Postman collection.

For me, Insomnia should convert empty fields (mine is Array when has no path) to null (or empty String, don't know) in import feature. That is the solution for this issue.