Article From:

Running the ng serve command can normally open the project, but the file page generated after running ng build is blank, and the build in the package file is changed to ng build –base-href.After NPM run build generates files, the page loads loading pages and then becomes blank pages. And the console is wrong as follows:

I hope that the God can help to answer, thank you!

Answer 0:

It turns out that the build in the package.json file is changed to ng build –base-href. /, the files generated by NPM build need to be accessed with HTTP protocol and can not be accessed directly with the file protocol. I am at WebstThe open in ORM is normal. At the same time, thank you for the warm answers of all the gods.

Answer 1:

–base-href / Removed from the slash. He should be an access path relative to the root directory of the site.

Answer 2:

ng build It may be a base path error in index.html after opening the blank. Try to change to:<base href="./">

Leave a Reply

Your email address will not be published. Required fields are marked *