ember-learn / ember-learn/ember-cli-addon-docs
`docs/route.js` Presence Causes API Documentation To Not Be Found/Error
- 主要言語
- JavaScript
- スター
- 172
- フォーク
- 142
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
I always use Ember's generators, even when creating my Dummy app's routes. Every time that I spun up `ember-cli-addon-docs` I'd translate the _getting started_ instructions to the `ember generate ...` commands.
This caused me to run an `ember g --dummy route docs` which politely creates my `template.hbs` and `route.js`. What I discovered was that if the `route.js` was present, my API documentation in the sidebar would only show up if I started at the `application-index` route and navigated directly to the docs route.
1. When the `docs` route would refresh, my API doc links in the sidebar would disappear.
1. If I was viewing a specific api-doc page and reloaded it, I'd get the following error: `Error while processing route: docs.api.item Cannot read property 'get' of null TypeError: Cannot read property 'get' of null`.
The fix for this was for me to remove my empty `docs/route.js`.
We might want to mention this in the _getting started_ documentation for `ember-cli-addon-docs` but even more we might want to fix this. I don't feel that the mere presence of an empty `docs/route.js` should somehow impede the `model()` hook from firing.
_I am happy to fork and fix this if someone knows what might be the ailing cause and can point me in the correct direction._ I too am happy to update the getting started section of your docs with this warning message.
Thanks again for this addon.
コントリビューションガイド
調査の方向性
まず、空の docs/route.js で動作を再現し、その後、そのファイルを削除した場合の動作する構成と比較します。docs route によって model() フックが API ドキュメントを提供できなくなる理由を追跡し、ファイルが存在する状態でサイドバーのリンクと API ドキュメントページの直接的な再読み込みが機能することを確認します。動作を修正できない場合は、getting started ドキュメントにこの警告を追加することを検討してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- web-dev
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100