While my website functions perfectly on the development server, I encounter a strange error when I publish it to production on GitHub pages. Visiting the URL (yanshuf0.github.io/portfolio) displays the page without any issues. However, if I try to access yanshuf0.github.io/portfolio/home, the page fails to load and generates a specific console log message.
https://i.sstatic.net/tS0Is.png
The error seems to be related to the 'home' section, which is perplexing because the base URL redirects correctly to the home URL where no problems are present.
RouterModule.forRoot([
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'blog', component: BlogComponent},
{ path: 'blog-post', component: BlogPostComponent},
{ path: '**', redirectTo: 'home' }
])
Does anyone have insight into what might be causing this issue?
Edit: Just clarifying that this issue does not occur on the development server. Edit2: The error disappears when I enter yanshuf0.github.io/portfolio/home/ with the trailing slash.