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

Feature request about riot.compile(url, callback) #2451

ShiMeiWo opened this issue Sep 26, 2017 · 2 comments

Feature request about riot.compile(url, callback) #2451

ShiMeiWo opened this issue Sep 26, 2017 · 2 comments


Copy link

@ShiMeiWo ShiMeiWo commented Sep 26, 2017

  1. Describe your issue:

Once trying compile tag file that not exists(e.g. riot.compile('not-exists.tag.html', onLoadTag) ), just we receive that GET not-exists.tag.html 404 (Not Found) on the console window. How about to throw a exception or to execute an error-callback when the compiler fails to load a tag file? It may be helpful to make 404 fallback page when we make SPA with routing library.


  1. Can you reproduce the issue?

in tags/content.tag.html:

      // I want to control the application when tag file is missing
      riot.compile('tags/' + pageID + '.tag.html', function(){
  1. On which browser/OS does the issue appear?

  2. Which version of Riot does it affect?

  3. How would you tag this issue?

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
Copy link

@GianlucaGuarini GianlucaGuarini commented Oct 1, 2017

In riot@3.7.3 riot will throw errors in case files will be not found on the server via runtime compilation.

Copy link

@ShiMeiWo ShiMeiWo commented Oct 3, 2017

I tried the below code and I got succeed to handle access error!

riot.compile.error = function(e) {
  //error-handling code
riot.compile('path/to/tagfile.tag', function(e) {
  // to change apprication mode...

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.