Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular “如何修复”;所有页面';s视图源返回404屏幕';s html“;在为Firebase服务时_Angular_Firebase_Google Cloud Functions_Angular Universal_Server Side Rendering - Fatal编程技术网

Angular “如何修复”;所有页面';s视图源返回404屏幕';s html“;在为Firebase服务时

Angular “如何修复”;所有页面';s视图源返回404屏幕';s html“;在为Firebase服务时,angular,firebase,google-cloud-functions,angular-universal,server-side-rendering,Angular,Firebase,Google Cloud Functions,Angular Universal,Server Side Rendering,我已经学习了这一课()关于如何将Angular Universal app部署到Firebase云函数 现在,当我为Angular应用程序提供服务时,比如npm run build:ssr&&cd函数&&npm run build&&firebase service,一切似乎都运行良好,没有错误 === Serving from '/Users/jopmiddelkamp/Projects/Test/firebase-test-app'... ⚠ Your requested "node"

我已经学习了这一课()关于如何将Angular Universal app部署到Firebase云函数

现在,当我为Angular应用程序提供服务时,比如
npm run build:ssr&&cd函数&&npm run build&&firebase service
,一切似乎都运行良好,没有错误

=== Serving from '/Users/jopmiddelkamp/Projects/Test/firebase-test-app'...

⚠  Your requested "node" version "8" doesn't match your global version "12"
i  hosting: Serving hosting files from: dist/browser
✔  hosting: Local server: http://localhost:5000
✔  functions: Emulator started at http://localhost:5001
i  functions: Watching "/Users/jopmiddelkamp/Projects/Test/firebase-test-app/functions" for Cloud Functions...
✔  functions[ssr]: http function initialized (http://localhost:5001/firebase-test-app/us-central1/ssr).
但是当我查看我的页面源代码时,它们都被解析为404页面源代码

因此,
localhost:5000/about
显示about页面

但是,
view source:localhost:5000/about
显示404页面的源代码

现在我认为
localhost:500/about
页面也出了问题。首先,它会像404一样呈现,但随后Angular客户端会引导并正确显示about页面

我只是不明白为什么第一个请求显示404页面。。我可以想象它与路由器中找不到的函数URL有关。但我只是没有足够的经验,在角度和火基还不明白为什么

与谷歌一起,我也找不到解决方案。。现在,由于缺乏经验,我可能一直在寻找工作关键字

希望这里有人能帮我解决这个问题?非常感谢

而且,我已经能够用一个非常基本的新的角度通用项目重现它


找到解决方案了吗?@Ayyash我最终在Google app Engine而不是Firebase中托管了该应用程序。有趣的是,我最终在端口5000中添加了一个固定的本地侦听器,出于某种原因,workedI也有同样的问题。有什么答案吗?找到解决方案了吗?@Ayyash我最终在Google app Engine而不是Firebase中托管了该应用。有趣的是,我最终在端口5000中添加了一个常量本地侦听器,出于某种原因,workedI也有同样的问题。有什么答案吗?