ember-cli-addon-docs icon indicating copy to clipboard operation
ember-cli-addon-docs copied to clipboard

Route is not retained after refresh

Open Turbo87 opened this issue 7 years ago • 2 comments

I'm on an internal project using [email protected]. When I'm looking at http://localhost:3141/docs/components/q-token-input (in Firefox) and then refresh the page it automatically takes me back to http://localhost:3141/docs/installation for some unknown reason. Visiting http://localhost:3141/docs/components/q-token-input directly has the same behavior, but navigating by using the sidebar works fine 🤔

Any ideas how to debug this?

/cc @samselikoff

Turbo87 avatar Mar 05 '19 10:03 Turbo87

Hmm... if it's deployed I wonder it has to do with the redirect logic we have? Given that it looks like you're developing locally I don't know how it could affect it but here's some relevant files:

  • https://github.com/ember-learn/ember-cli-addon-docs/blob/b4bfe91ad58406808b960fc1870d571b16b462a4/vendor/ember-cli-addon-docs/github-spa.html
  • https://github.com/ember-learn/ember-cli-addon-docs/blob/731830a208e6a36562a4639867439649720a032a/vendor/ember-cli-addon-docs/404.html

Other than that are you using the AddonDocsRouter import when setting up your docs routes? https://ember-learn.github.io/ember-cli-addon-docs/docs/quickstart

samselikoff avatar Mar 05 '19 11:03 samselikoff

our router.js file:

import AddonDocsRouter, { docsRoute } from 'ember-cli-addon-docs/router'
import config from './config/environment'

const Router = AddonDocsRouter.extend({
  location: config.locationType,
  rootURL: config.rootURL
})

Router.map(function() {
  docsRoute(this, function() {
    this.route('installation')

    this.route('components', function() {
      this.route('q-address-input')
      this.route('q-token-input')
    })
  })

  this.route('not-found', { path: '/*path' })
})

export default Router

I'm not using any deployment right now, just running the dummy app via ember serve 🤔

Turbo87 avatar Mar 05 '19 12:03 Turbo87