Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember-cli /dist files do not run when run directly

I have a ember cli project and when running ember server it works, however if I try run the /dist/index.html directly it cannot find the files such as dist/assets/vendor.js

I need these files to work as I will be sharing this code to run in a server.

enter image description here

enter image description here

like image 960
SuperUberDuper Avatar asked Mar 06 '26 22:03

SuperUberDuper


1 Answers

An http server is required because of the <base> tag in the index.html file that specifies the base URL to use for all relative URLs contained within a document. So when your app is trying to serve up the assets/app.js or assets/vendor.js, its trying to look relative to this base url, which is defined in config/environment.js. It defaults to /. So you need a server to respond to the resource requests for the assets. Notice that your assets folder is relative to the index.html file, but inside the dist folder which is not treated the same as / by your browser

tl;dr You can't just double click your application's index.html, open it in a browser, and expect it to work. It must be served

like image 64
mistahenry Avatar answered Mar 10 '26 16:03

mistahenry