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

"Cannot set property 'items' of undefined" - issue building schemas.log.properites? #6

Closed
jackwanders opened this issue Mar 30, 2015 · 7 comments

Comments

@jackwanders
Copy link

A project I work on has a dependency on the npm request package, which recently added HAR validation support in v2.54.0:

request/request@4396aef

When we ran a fresh dependency installation on our project, we started getting the following error on server startup:

TypeError: Cannot set property 'items' of undefined
    at Object.<anonymous> (/.../node_modules/request/node_modules/har-validator/src/index.js:36:36)

This leads to the following line in your codebase:

https://github.com/ahmadnassri/har-validator/blob/6b5e9d0093bf1a4deac8f003182983d9239ad131/src/index.js#L36

schemas.log.properties.pages.items = schemas.page

It appears that for some reason schemas.log.properties.pages is undefined, causing this line and by extension our server to fall down.

For the time being, we've fixed our dependency on request to v2.53.0, but I thought it was worth alerting you to this. Any thoughts on if this is an issue in your module or request's use of it?

@ahmadnassri
Copy link
Owner

@jackwanders interesting, I never came across this.. I'll debug in both request and here.

in the meantime, request dependency on har-validator should be version fixed to 1.4.0

@ahmadnassri
Copy link
Owner

@jackwanders just downloaded request from source and ran npm test all were successful including har-validator related tests ... can you give me some steps to reproduce? perhaps your server setup up to the point of including/using request?

@ahmadnassri
Copy link
Owner

this is very peculiar (though may end up being an obvious problem) schemas.log.properties is populated from log.json and it seems the previous lines did not error out!

@raadad
Copy link

raadad commented Apr 2, 2015

I am having this issue, and only started getting it two days ago, ill see what I can come up with

@ahmadnassri
Copy link
Owner

@raadad thanks, any steps to re-produce (perhaps your package.json) and some of your app.js would be great to help debug!

@trevan
Copy link

trevan commented Apr 2, 2015

I had this same problem and after upgrading har-validator to 1.6.1, the problem went away.

@ahmadnassri
Copy link
Owner

@trevan interesting, I don't honestly see how the changes in 1.6.1 address the issue (was just some re-ordering of files) ... but glad it got fixed!

@raadad @jackwanders can you confirm v1.6.1 fixes this for you as well?

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

No branches or pull requests

4 participants