ember-learn / ember-learn/ember-cli-addon-docs

`docs/route.js` Presence Causes API Documentation To Not Be Found/Error

Abierto
#388 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
172
Forks
142
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza reproduciendo el comportamiento con un archivo docs/route.js vacío y, después, compáralo con la configuración funcional en la que se elimina ese archivo. Traza por qué la ruta de docs impide que el hook model() proporcione documentación de la API y confirma que los enlaces de la barra lateral y las recargas directas de las páginas de documentación de la API funcionan cuando el archivo está presente; considera actualizar la documentación de getting started con la advertencia si no se puede corregir el comportamiento.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
web-dev
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.