Skip to content

Cannot read property 'src' of undefined #21

@chrislim

Description

@chrislim

I noticed that the bug I was encountering in this issue assemble/assemble#547 may have been caused by this line/the following line:
https://github.com/helpers/handlebars-helper-compose/blob/master/index.js#L52
ctx.page is undefined so an error is thrown when we try to reference src from it.

I added a try catch block around it and suppressed the error and it seems like the build succeeds and the site runs. However, I didn't get a chance to examine the wider to context to see why ctx.page is undefined when passed in the first place and also why the error doesn't show up until I have more than 10 pages to render (.hbs files). The catch block seemed to be hit even when I had less than 10 pages, but grunt would not throw the error

Warning: Cannot read property 'src' of undefined

Unless I had more than 10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions