danielgtaylor / danielgtaylor/aglio

TypeError: Cannot read property 'content' of undefined`

Open
#237 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
CoffeeScript
Stars
4.7k
Forks
471
PR merge metrics
No merged PRs in 30d

Description

We are constantly getting this error when trying to run aglio (we run it as a server, but it also happen when output goes to a file):

```
$ aglio -i sample.apib.md -s -p 9876
Server started on http://127.0.0.1:9876/
Rendering sample.apib.md
/Users/amuino/.nvm/versions/node/v5.6.0/lib/node_modules/aglio/node_modules/aglio-theme-olio/lib/main.js:387
ref = api.content || [];
^

TypeError: Cannot read property 'content' of undefined
at decorate (/Users/amuino/.nvm/versions/node/v5.6.0/lib/node_modules/aglio/node_modules/aglio-theme-olio/lib/main.js:387:14)
at Object.exports.render (/Users/amuino/.nvm/versions/node/v5.6.0/lib/node_modules/aglio/node_modules/aglio-theme-olio/lib/main.js:645:5)
at /Users/amuino/.nvm/versions/node/v5.6.0/lib/node_modules/aglio/lib/main.js:133:20
```

I've attached the minimal test case input file (zipped so that Github will allow me):
[sample.apib.md.zip](https://github.com/danielgtaylor/aglio/files/144166/sample.apib.md.zip)

The error disappears when any of this happens:
- Rename data structure `Booking State Params`. Not all renames work (seems like inserting/appending chars to the last word does not fix the issue)
- Renaming data structure `Booking State Response` so that it does not match the name in Attributes (gives a nice format error)
- Removing any `O*` data structure
- Making `Point` an object instead of an array
- Removing the reference to `Booking State Response` from the Response (any `O*` seems to work, probably because it does not reference `Point`)

Versions:

```
$ aglio -v
aglio 2.2.0
olio 1.6.2
$ node -v
v5.6.0
$ npm -v
3.6.0
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.