admin管理员组

文章数量:1395885

I recently updated an ember-cli project from 0.0.44 to 0.1.1 and all of the sudden my templates are not loading anymore, instead I get the following warnings on the console:

Could not find "application" template or view. Nothing will be rendered Object {fullName: "template:application"}

Could not find "index" template or view. Nothing will be rendered Object {fullName: "template:index"}

The steps I took to update the project was just:

npm install --save-dev ember-cli
ember init

this is my router:

import Ember from 'ember';
import config from './config/environment';

var Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
  this.route('login');
  this.route('permission');
  this.route('user');
  this.route('room');
  this.route('room/new');
});

Router.reopen({
  notifyGoogleAnalytics: function() {
    return window.ga('send', 'pageview', {
      'page': this.get('url'),
      'title': this.get('url')
    });
  }.on('didTransition')
});

export default Router;

this is my app.js:

import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import config from './config/environment';

Ember.MODEL_FACTORY_INJECTIONS = true;

var App = Ember.Application.extend({
  modulePrefix: config.modulePrefix,
  autoprefixer: {
    browsers: ['> 1%', 'last 1 version', 'android 4', 'ios 6']
  },
  podModulePrefix: config.podModulePrefix,
  Resolver: Resolver
});

loadInitializers(App, config.modulePrefix);

export default App;

any help?

I recently updated an ember-cli project from 0.0.44 to 0.1.1 and all of the sudden my templates are not loading anymore, instead I get the following warnings on the console:

Could not find "application" template or view. Nothing will be rendered Object {fullName: "template:application"}

Could not find "index" template or view. Nothing will be rendered Object {fullName: "template:index"}

The steps I took to update the project was just:

npm install --save-dev ember-cli
ember init

this is my router:

import Ember from 'ember';
import config from './config/environment';

var Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
  this.route('login');
  this.route('permission');
  this.route('user');
  this.route('room');
  this.route('room/new');
});

Router.reopen({
  notifyGoogleAnalytics: function() {
    return window.ga('send', 'pageview', {
      'page': this.get('url'),
      'title': this.get('url')
    });
  }.on('didTransition')
});

export default Router;

this is my app.js:

import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import config from './config/environment';

Ember.MODEL_FACTORY_INJECTIONS = true;

var App = Ember.Application.extend({
  modulePrefix: config.modulePrefix,
  autoprefixer: {
    browsers: ['> 1%', 'last 1 version', 'android 4', 'ios 6']
  },
  podModulePrefix: config.podModulePrefix,
  Resolver: Resolver
});

loadInitializers(App, config.modulePrefix);

export default App;

any help?

Share Improve this question edited Oct 10, 2014 at 3:58 Gustavo Siqueira asked Oct 9, 2014 at 19:20 Gustavo SiqueiraGustavo Siqueira 8621 gold badge9 silver badges27 bronze badges 5
  • @undefined its obviously because that thing isnt in that place – mistahenry Commented Oct 9, 2014 at 19:41
  • I tested with a fresh install from 0.0.44 and updated to 0.1.1 and it worked, so I'll just pare both and see what is out of place – Gustavo Siqueira Commented Oct 9, 2014 at 19:52
  • what is the route application.index ? what directory are your templates in, can u provide all the information :) – Billybonks Commented Oct 10, 2014 at 2:49
  • I added my route.js file to the question, and my templates are in app/templates/, all named with .hbs, both application.hbs and index.hbs are there. – Gustavo Siqueira Commented Oct 10, 2014 at 4:00
  • and I'm using ember-simple-auth as well – Gustavo Siqueira Commented Oct 10, 2014 at 4:02
Add a ment  | 

2 Answers 2

Reset to default 13

This should help:

npm cache clear
bower cache clean
rm -rf dist tmp bower_ponents node_modules
npm install
bower install

Well I have to say that I tried @quaertym solution and it brought me a lot of problems. For other people it might help that this mand:

rm -rf dist tmp bower_ponents node_modules

works great in OSX and Linux but as the documentation says https://ember-cli./user-guide/#upgrading:

For Windows, use this mand.

rd /s /q node_modules bower_ponents dist tmp

本文标签: