I'm attempting to replicate the steps outlined in this tutorial found here https://www.youtube.com/watch?v=gxCu5TEmxXE. However, upon running tsc -p
, I encounter an error. Is there a specific import that I am missing?
ERROR:
node_modules/@angular/common/src/location/location.d.ts(1,10): error TS2305: Module '"...functions/node_modules/rxjs/Rx"' has no exported member 'SubscriptionLike'.
TS FILE
import "zone.js/dist/zone-node";
import * as functions from "firebase-functions";
import * as express from "express"
import { renderModuleFactory } from "@angular/platform-server"
import * as fs from "fs"
const document = fs.readFileSync(__dirname + "/dist-server/index.html", "utf8");
const AppServerModuleNgFactory = require(__dirname + "/dist-server/main.bundle");
const app = express();
app.get("**", (req, res) => {
const url = req.path;
renderModuleFactory(AppServerModuleNgFactory, { document, url }).then(html => {
res.send(html);
});
});
exports.post = functions.https.onRequest(app);
CONFIG
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"rootDir": ".",
"outDir": "../functions"
},
"files": [
"index.ts"
]
}