重新加载页面时Angular Universal崩溃(路由不起作用)

时间:2019-12-08 17:53:36

标签: angular firebase express angular-universal

只需在firebase上部署Angular Unversal Web应用程序即可。应用程序内部的所有路由都可以正常工作,但是当尝试从外部访问它们时,服务器返回错误。 这是错误消息:

[ { gpName: "amir", gpPass: "123", gpID: "24d5426b", gpPeople{obj:{}} } ]

这是server.ts文件:

functions: Beginning execution of "ssr"
⚠  functions: TypeError: handler is not a function
    at cloudFunction (/home/dell/Documents/personal/motor-bike/functions/node_modules/firebase-functions/lib/providers/https.js:49:9)
    at /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:608:20
    at /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:582:19
    at Generator.next (<anonymous>)
    at /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:7:71
    at new ZoneAwarePromise (/home/dell/Documents/personal/motor-bike/functions/dist/server.js:6245:33)
    at __awaiter (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:3:12)
    at Run (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:575:12)
    at /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:607:15
    at Generator.next (<anonymous>)
⚠  Your function was killed because it raised an unhandled error.
127.0.0.1 - - [08/Dec/2019:17:07:54 +0000] "GET /elektriniai-dviraciai-centrinis-motoras HTTP/1.1" 500 948 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
127.0.0.1 - - [08/Dec/2019:17:07:54 +0000] "GET /favicon.ico HTTP/1.1" 200 5430 "http://localhost:5000/elektriniai-dviraciai-centrinis-motoras" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"

0 个答案:

没有答案