Quantcast
Viewing all articles
Browse latest Browse all 4827

Helper cannot be found

@johnnyicon wrote:

We just started experience this issue on a new developer coming onto our project. So it's working on all previous developers' environments, but not on this new one.

This is the error we're getting in console:

Uncaught Error: Compile Error: humanDate is not a helper

It's being called in an hbs template like so:

<td>{{ humanDate solution.updatedAt }}</td>

This is what the helper file looks like. It can be found in myapp/app/helpers/human-date.js

import Ember from 'ember';
import moment from 'moment';

export function humanDate(params) {
  let datetime = params[0];

  if (datetime) {
    return moment(datetime).format('LL');
  } else {
    return '';
  }
}

export default Ember.Helper.helper(humanDate);

We were running 2.10.0-beta1. I just upgraded the app to 2.11.0 hoping that would fix the issue, but it didn't. We've been tinkering away for the last 3-4 hours and I figure now is about time to ask for help.

Any help would be appreciated!

Thanks!

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4827

Trending Articles