Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start tour, always get error: "Tour ended, init prevented." #184

Closed
borfast opened this issue Jan 1, 2014 · 4 comments
Closed
Labels

Comments

@borfast
Copy link

borfast commented Jan 1, 2014

I'm using version 0.8 but I don't seem to be able to start a tour at all. I activated the debug option and always get the following error message on my console:

Tour ended, init prevented.

Unfortunately it doesn't say anything else, so I have no idea about what's wrong. I am including both the CSS and the JS file in my HTML code, and stripped down my tour code to the simplest, just like the example on the home page:

// Instance the tour
var tour = new Tour({debug: true});

// Add your steps. Not too many, you don't really want to get your users sleepy
tour.addSteps([
  {
    element: "#btn-1",
    title: "Title of my step",
    content: "Content of my step"
  },
  {
    element: "#btn-2",
    title: "Title of my step",
    content: "Content of my step"
  }
]);

// Initialize the tour
tour.init();

// Start the tour
tour.start();

Am I doing something wrong?
Is the error message I mentioned at the top something with a common / well known cause?
What could be triggering it?

@emmenko
Copy link
Contributor

emmenko commented Jan 2, 2014

Hi @borfast, have you checked the localStorage? The tour is probably ended and there should be a key tour_end: yes.

You can solve this in 2 ways:

  • check if the tour is ended, then restart it automatically or by user input
tour.init();
tour.start();
if (tour.ended()) {
  // decide what to do
  tour.restart();
}
  • always restart the tour instead of calling start
tour.init();
tour.restart();

@borfast
Copy link
Author

borfast commented Jan 2, 2014

Weirdly enough, today it is working again, even though I didn't change anything...
Thanks for the quick reply anyway! Maybe it will come in handy if it happens again.

@borfast borfast closed this as completed Jan 2, 2014
@chadb
Copy link

chadb commented Jan 16, 2014

Thank you this helped me. I didn't realize how clever the code was by using local storage.

@doganmeh
Copy link

in some occasions tour.restart() did not help; so I had to clear localStorage for tour_current_step as well:

localStorage.removeItem('tour_current_step')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants