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

Paths failing to run at all #244

Closed
teknetia opened this Issue Aug 2, 2015 · 8 comments

Comments

Projects
None yet
3 participants
@teknetia

teknetia commented Aug 2, 2015

I've created a couple of layouts and routes but when I try to go to any of them (root included) I just get failure messages. I have been through multiple things and can't figure out what would be causing the grief. I am sure it is something silly and I have overlooked it but no amount of googling or re-coding has achieved anything beneficial. Any help massively appreciated!

Errors in the Chrome Console:
screen shot 2015-08-02 at 12 38 24

lib/router.js:

FlowRouter.notfound = {
    action: function() {
        BlazeLayout.render('Blank', { content: 'NotFound' });
    }
};

//Home page routes
FlowRouter.route('/', {
    name: 'home',
    action: function() {
        BlazeLayout.render('Standard', { content: 'Dashboard' } );
        console.log('Home rendered');
    }
});

//Login page
FlowRouter.route('/login', {
    name: 'login',
    action: function() {
        BlazeLayout.render('Blank', { content: 'Login' });
    }
});

//Register page
FlowRouter.route('/register', {
    name: 'register',
    action: function() {
        BlazeLayout.render('Blank', { content: 'Register' });
    }
});

client/global.html:

<template name="Standard">
    {{> Header}}
    {{> Template.dynamic template=content}}
    <footer>
        <p>&copy; Copyright 2015 • All Rights Reserved</p>
    </footer>
</template>

<template name="Blank">
    <div class="background brand-bg">
        {{> Template.dynamic template=content}}
    </div>
</template>

<template name="Header">
    <h1>This is the header</h1>
    <p>Hello, you're logged in!</p>
</template>

<template name="NotFound">
    <h1>404 Not Found!</h1>
    <p>Oops, can't find that, sorry!</p>
</template>

client/login/login.html:

<template name="Login">
    <div class="small-container">
        <header>
            <img src="http://placehold.it/200x200">
            <h1>Login to see your dashboard</h1>
        </header>
        <form class="login-form" id="loginForm" method="post">
          <label for="loginEmail">Email address</label>
          <input type="email" name="loginEmail" placeholder="Email address">
          <label for="loginPassword">Password</label>
          <input type="password" name="loginPassword" placeholder="Password">
          <a href="{{route 'register'}}" class="light button">Register</a>
          <input type="submit" class="login-btn" value="Login">
        </form>
        <hr>
        <ul>
            <li><button type="button" class="login-google"><i class="fa fa-google"></i> Sign in with Google</button></li>
            <li><button type="button" class="login-microsoft"><i class="fa fa-windows"></i> Sign in with Microsoft</button></li>
        </ul>
    </div>
</template>

<template name="Register">
  <div class="background brand-bg">
    <header>
        <img src="http://placehold.it/200x200">
        <h1>Register</h1>
    </header>
    <form class="register-form" id="registerForm" method="post">
        <label for="registerName">Your name</label>
        <input type="text" name="registerName" placeholder="Your name">
      <label for="registerEmail">Email address</label>
      <input type="email" name="registerEmail" placeholder="Email address">
      <label for="registerPassword">Password</label>
      <input type="password" name="registerPassword" placeholder="Password">
      <label for="registerPasswordConfirm">Confirm your password</label>
      <input type="password" name="registerPasswordConfirm" placeholder="Password">
      <label for="registerCompany">Company name</label>
      <input type="text" name="registerCompany" placeholder="Company">
      <input type="submit" class="register-btn" value="Register">
    </form>
    <hr>
    <ul>
        <li><button type="button" class="login-google"><i class="fa fa-google"></i> Sign in with Google</button></li>
        <li><button type="button" class="login-microsoft"><i class="fa fa-windows"></i> Sign in with Microsoft</button></li>
    </ul>
    <p>Already have an account? <a href="{{route 'login'}}">Return to the login page.</a></p>
  </div>
</template>

<template name="PermissionDenied">
    <h1>Permission denied</h1>
    <p>Sorry, you don't have permission to see this page.</p>
</template>

<template name="SignOut">
    <a class="sign-out" href="/" id="signOut">Log Out</a>
</template>
@stocksp

This comment has been minimized.

Show comment
Hide comment
@stocksp

stocksp Aug 2, 2015

change your template name to 'login' (lowercase)

stocksp commented Aug 2, 2015

change your template name to 'login' (lowercase)

@teknetia

This comment has been minimized.

Show comment
Hide comment
@teknetia

teknetia Aug 2, 2015

I had it that way originally and it still failed, but let me try it again anyway
to be sure. That doesn't explain why / fails though?

On Sun, Aug 2, 2015 at 13:12, kadirahq/flow-router
reply@reply.github.com
wrote:
change your template name to 'login' (lowercase)


Reply to this email directly or view it on GitHub
[https://github.com//issues/244#issuecomment-126984874] .[https://github.com/notifications/beacon/AHmf-bj2_oodjPXII6a06FsfSnLl0rosks5ojYIXgaJpZM4FkFLt.gif]

teknetia commented Aug 2, 2015

I had it that way originally and it still failed, but let me try it again anyway
to be sure. That doesn't explain why / fails though?

On Sun, Aug 2, 2015 at 13:12, kadirahq/flow-router
reply@reply.github.com
wrote:
change your template name to 'login' (lowercase)


Reply to this email directly or view it on GitHub
[https://github.com//issues/244#issuecomment-126984874] .[https://github.com/notifications/beacon/AHmf-bj2_oodjPXII6a06FsfSnLl0rosks5ojYIXgaJpZM4FkFLt.gif]

@stocksp

This comment has been minimized.

Show comment
Hide comment
@stocksp

stocksp Aug 2, 2015

I was just responding to the error message you posted.

stocksp commented Aug 2, 2015

I was just responding to the error message you posted.

@arunoda

This comment has been minimized.

Show comment
Hide comment
@arunoda

arunoda Aug 2, 2015

Contributor

I would love to see a repo with this issue. That's really help me to dig
into this.
On 2015 අගෝ 2, ඉරිදා at පෙ.ව. 8.46 Paul Stocks notifications@github.com
wrote:

I was just responding to the error message you posted.


Reply to this email directly or view it on GitHub
#244 (comment)
.

Contributor

arunoda commented Aug 2, 2015

I would love to see a repo with this issue. That's really help me to dig
into this.
On 2015 අගෝ 2, ඉරිදා at පෙ.ව. 8.46 Paul Stocks notifications@github.com
wrote:

I was just responding to the error message you posted.


Reply to this email directly or view it on GitHub
#244 (comment)
.

@teknetia

This comment has been minimized.

Show comment
Hide comment
@teknetia

teknetia Aug 2, 2015

I can give you read only access temporarily to it easily enough, it is a private repo. Will do it now for you and push my latest files up. It will be on branch feature/login.

teknetia commented Aug 2, 2015

I can give you read only access temporarily to it easily enough, it is a private repo. Will do it now for you and push my latest files up. It will be on branch feature/login.

@arunoda

This comment has been minimized.

Show comment
Hide comment
@arunoda

arunoda Aug 2, 2015

Contributor

You are using arillo:flow-router-helpers package. It's not yet updated for the new flow-router. So, now you've two flow-router version in your app. That's the issue.

Contributor

arunoda commented Aug 2, 2015

You are using arillo:flow-router-helpers package. It's not yet updated for the new flow-router. So, now you've two flow-router version in your app. That's the issue.

@teknetia

This comment has been minimized.

Show comment
Hide comment
@teknetia

teknetia Aug 2, 2015

Interesting! I forgot I even had the package. I have removed it but I still see issues. Unsure if it is related to FlowRouter now or something else entirely. Possibly it is related to Blaze?

The error is about route. As below

Exception in defer callback: Error: No such function: route

screen shot 2015-08-03 at 08 08 42

teknetia commented Aug 2, 2015

Interesting! I forgot I even had the package. I have removed it but I still see issues. Unsure if it is related to FlowRouter now or something else entirely. Possibly it is related to Blaze?

The error is about route. As below

Exception in defer callback: Error: No such function: route

screen shot 2015-08-03 at 08 08 42

@teknetia

This comment has been minimized.

Show comment
Hide comment
@teknetia

teknetia Aug 2, 2015

Interestingly going to / logs the message from the route, but doesn't render the template (I'd expect the footer at least to show up).

teknetia commented Aug 2, 2015

Interestingly going to / logs the message from the route, but doesn't render the template (I'd expect the footer at least to show up).

@arunoda arunoda added the feature label Aug 10, 2015

@arunoda arunoda closed this Aug 10, 2015

@arunoda arunoda removed the feature label Aug 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment