I'm facing an issue with deploying my Angular web app project on Google App Engine. The project builds and runs locally without any problems, but when I deploy it using 'gcloud app deploy', the app is not served properly.
Even though GAE can build the project, when it serves the 'index.html' file, I encounter a "404 Not Found" error.
https://i.sstatic.net/0kcOAMFC.png
The only intriguing message in the GAE build log is as follows:
Using config appstart.Config{Runtime:"nodejs22", Entrypoint:appstart.Entrypoint{Type:"Default", Command:"/serve", WorkDir:""}, MainExecutable:""}
The presence of MainExecutable:""
raises some questions for me. Is this correct?
I've extensively reviewed the documentation related to 'app.yaml', 'angular.json', and 'tsconfig.json' configuration files and their possible attributes, but I haven't been able to identify what could be wrong.
As a troubleshooting step, I even created a new Angular example project using 'ng new' and tried deploying it with default settings, but encountered the same issue.
Below are snippets from my configuration files:
app.yaml
:
runtime: nodejs22
service: [app-name]
handlers:
- url: /(.*\.css)
static_files: dist/[app-name]/\1
upload: dist/[app-name]/(.*\.css)
... (remaining content omitted for brevity)
angular.json
:
{
// Angular JSON configuration snippet
// ... (content omitted for brevity)
}
tsconfig.json
:
{
// TypeScript configuration snippet
// ...(content omitted for brevity)
}
.gcloudignore
:
# List of files not uploaded to Google Cloud using gcloud
# ... (content omitted for brevity)
.gcloudignore
# Include the dist directory where build output is stored
!dist/
// Other exclusion/inclusion rules...
If more information or logs are required for better analysis, please let me know. Any assistance in resolving this issue would be highly appreciated!