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.


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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With