Error : “The URL '/index.html' did not match any routes in your application”

StackOverflow https://stackoverflow.com//questions/25069631

  •  26-12-2019
  •  | 
  •  

Question

Im trying to use ember build to build and deploy an ember-cli app. But Im running into an error when the page loads:

Error: Assertion Failed: The URL '/index.html' did not match any routes in your application at new Error (native) at Error.EmberError (file:///Users/me/Work/lunch-picker/dist/assets/vendor.js:26504:23) at Object.Ember.assert (file:///Users/me/Work/lunch-picker/dist/assets/vendor.js:16791:15) at file:///Users/me/Work/lunch-picker/dist/assets/vendor.js:37949:17 at tryCatch (file:///Users/me/Work/lunch-picker/dist/assets/vendor.js:58376:20) at invokeCallback (file:///Users/me/Work/lunch-picker/dist/assets/vendor.js:58385:21) at publish (file:///Users/me/Work/lunch-picker/dist/assets/vendor.js:58363:17) at publishRejection (file:///Users/me/Work/lunch-picker/dist/assets/vendor.js:58314:9) at file:///Users/me/Work/lunch-picker/dist/assets/vendor.js:41939:9

This is what my router.js looks like

this.resource('lunches', { path: '/'}, function(){
  this.route('unserved');
  this.route('served');
});
this.route('login');

I have no problems using ember serve, which shows me this as the next debug log in the console:

route:application .......................................... lunch-picker/application/route

I'm using ember-cli 0.0.39; and in config/environment.js

baseURL: 'Users/me/Work/lunch-picker/dist/',

and access it in the browser via:

file:///Users/me/Work/lunch-picker/dist/index.html

Not exactly sure how to debug this, or if someone looking at this has the information they need to help.

Thanks!

Était-ce utile?

La solution

With the location option set to auto, your application is likely using history based routing. You can read more about history based routing at the link I gave in the comments. In short, you probably want to set your location option to hash so you don't have to make any server side changes.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top