Skip to content

Facing issue for deployment with Angular6 #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sahilkatia opened this issue Sep 23, 2018 · 5 comments
Closed

Facing issue for deployment with Angular6 #45

sahilkatia opened this issue Sep 23, 2018 · 5 comments

Comments

@sahilkatia
Copy link

 npm install -g angular-cli-ghpages
$ ng build --prod --base-href https://sahilkatia.github.io/resume/

ngh --dir dist/resume

Even then I am facing error

below is the screen
capture

@fmalcher
Copy link
Member

fmalcher commented Sep 23, 2018

See this comment for further info: #37 (comment). In fact, this has nothing to do with this project or with Angular itself. You need to set the base-href just as a folder path, not with the complete URL.

ng build --prod --base-href=/resume/

@sahilkatia
Copy link
Author

I am still facing same issue. Although its running perfect on my local
capture

@JohannesHoppe
Copy link
Member

Please run exactly this:

ng build --prod --base-href /resume/
ngh --dir dist/resume

OR this

ng build --prod --base-href https://sahilkatia.github.io/resume/
ngh --dir dist/resume

@fmalcher
Copy link
Member

Please take a look at your index.html inside your dist directory. You will find the base href at the top.
At the moment it's set to this which is definitely invalid 😉

screen shot 2018-09-25 at 08 38 36

@suga0828
Copy link

suga0828 commented Oct 28, 2018

I have a similar problem. I have already uploaded my files and the page is displayed well except for one image. The path of the image is different from the path where the image is saved.

Naturally I get a 404 error:
menu.png: 1 GET https://suga0828.github.io/assets/images/menu.png 404

The image is saved in the route:
https://suga0828.github.io/suga0828/assets/images/menu.png

When I inspect the image I observe the route:

src = "../ assets / images / menu.png"

which is the same as I have in my code but it will only work with:

src = "./ assets / images / menu.png"

I know that the problem is the path that has the img tag, not the path where the image is saved but I can not solve the problem.

Resolve.

You can use the path: src="assets/images/menu.png" in the image tag and its works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants