I'm trying to follow this example here https://www.youtube.com/watch?v=gxCu5TEmxXE, but when doing tsc -p
, I get an error. Is there something I need to import?
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"
]
}
I faced the same issue after following
Following this tutorial from djamware
After searching a lot, I have found that Rxjs package that is installed through instructions in this tutorial is not supported with Angular 6.
Angular 6 does not work with RxJS 5.5 but with RxJS 6.
npm i rxjs@6
Run the above command in cli and that should fix your problem. It did in my case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With