Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when adding scripts to a request previously bootstrapped with none. #37

Closed
kevinswiber opened this issue Aug 11, 2020 · 0 comments · Fixed by #42
Closed

Error when adding scripts to a request previously bootstrapped with none. #37

kevinswiber opened this issue Aug 11, 2020 · 0 comments · Fixed by #42

Comments

@kevinswiber
Copy link
Contributor

After adding a prerequest.js to a request directory locally, I received an error on postman sync.

➜ postman sync
(node:32815) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'findIndex' of undefined
    at mapFileToItem (/usr/local/lib/node_modules/@matt.ball/postman-cli/src/sync.js:23:31)
    at recurseCollectionForItems (/usr/local/lib/node_modules/@matt.ball/postman-cli/src/lib/recurse-collection.js:34:20)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async recurseCollectionForItems (/usr/local/lib/node_modules/@matt.ball/postman-cli/src/lib/recurse-collection.js:40:7)
    at async recurseCollection (/usr/local/lib/node_modules/@matt.ball/postman-cli/src/lib/recurse-collection.js:13:5)
    at async Command.sync (/usr/local/lib/node_modules/@matt.ball/postman-cli/src/sync.js:9:22)

The error is here: https://github.com/matt-ball/postman-cli/blob/cdaa51c05ffde6d68e8465df2d6e30d6e4b0b7ab/src/sync.js#L23

In this case, req.event does not exist and needs to be created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant