'ng build creates a blank index.html
I'm trying to build my Angular project, which works with ng serve, but every time I try to deploy it with ng build, I only get a blank page.
I have already tried to modify <base href="/"> on the index. html on the dist folder, as I already saw that most problems are due to the relative path to the content, but changing it to "./" doesn't have any effect.
What could it be?
Solution 1:[1]
I don't know how you opened the index.html file, however it is not uncommon for the index.html to be empty. So if you only have the index.html file open in your browser, there will inevitably be no content there.
Modifying the <base>-tag will not achieve the desired goal.
To exclude errors in the code use codesandbox.io. For this:
Log in to codesandbox.io
Create a
new sandboxChoose the sandbox type
VanillaCopy the files of the
distdirectory into the sandbox
If the desired content appears here, the error is on the server side.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
