angular-seed: Production Build wrong paths - Windows 10

Hello Guys, I have been trying to make a production build. However, when I try to run it after it has been built, the browser cannot load the necessary node_modules and files necessary.

OS: Windows 10 Node version: 5.10.1 npm version: 3.8.3 Browsers: chrome 50.0.2661.75 m, firefox 45.0.2

After running npm run build.dev there are no errors, but when I try to open the production build, it tells me that files are missing.

angular2-cli

Here is a screenshot of the console errors:

angular2-errors

What I can see is that after I run the production build, it changes the paths of all the files to wrong ones. The absolute path looks for node_modules on C:\ which I find kind of odd.

Anyone facing a similar issue on windows ?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

I see this happening only when you open it up from the file system(for e.g. on double clicking the index.html).

If I host it on a server, everything works fine.

@mgechev I manually solved it by modifying the index.html file.

If anyone is facing the same issue. Delete this line: <base href="/">

And modify the following three lines:

<link rel="stylesheet" href="/css/all.css?1460650832631">
<script src="/js/shims.js?1460650832626"></script>
<script src="/js/app.js?1460650832628"></script>

By removing the first /

<link rel="stylesheet" href="css/all.css?1460650832631">
<script src="js/shims.js?1460650832626"></script>
<script src="js/app.js?1460650832628"></script>

@mgechev I made a few changes. More specifically, I added a couple of components but I didn’t mess with any configuration file. I will try to make a fresh clone and share with you guys the result.