Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Angular 19 SSR cloud functions ESM build

Đang mở
#3,645 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
43/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
angular, express, firebase, node.js, typescript
Lĩnh vực
backend, cloud

Hướng nghiên cứu

Bắt đầu với universal.ts và render.js, sau đó tái hiện khác biệt đã được báo cáo giữa ng build (build-angular:application), node ./server.mjs và việc triển khai các hàm SSR. Kiểm tra dist/stamp-app/server/server.mjs được tạo ra cùng các artifact của trình duyệt, đối chiếu với thiết lập vanilla của Cloud Functions. Hoàn tất khi hàm SSR phục vụ và triển khai thành công với bản build ESM.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

  • unable to serve/deploy ssr functions esm build artifacts with vanilla cloud functions
  • able to ng serve, ng build (build-angular:application), and node ./server.mjs
  • other functions unrelated to SSR are working (server backend) as intended

Heres my SSR setup:

universal.ts

import { onRequest } from 'firebase-functions/v2/https';
import { render } from '../../render.js';
import express, { Request, Response, NextFunction } from 'express';
import * as server from '../../../dist/stamp-app/server/server.mjs';
export const ssrApp = express() as any;

ssrApp.use(express.static('dist/stamp-app/browser'));
ssrApp.get('*', async (req: Request, res: Response, next: NextFunction) => {
	const ssr: any = await render(server, req, res, next);
	res.send(ssr);
});

export const universal = onRequest(
	{ maxInstances: 10, timeoutSeconds: 1200, cpu: 1, memory: '2GiB', region: ['us-central1'] },
	ssrApp
);

render.js

import { Request, Response, NextFunction } from "express";

export async function configServerApp(app: any, req: Request, res: Response, next: NextFunction) {
  //configure app here & retrieve HTML
  let template;
  if (req.path === '/') {
    // template = await fetch('@dist/stamp-app/browser/index.csr.html');
    next();
  }
  template = `<div>HTML CONTENT FOR SSR APP</div>`;
  return template;
}
export async function render(app: any, req: Request, res: Response, next: NextFunction) {
  const ssrApp = await configServerApp(app, req, res, next);
  return ssrApp;
}

am I missing something..? thanks for any help in advance

Ngôn ngữ chính
TypeScript
Star
7.8k
Fork
2.2k
Merge trung bình
3 ngày 6 giờ
Pull request đã merge (30 ngày)
5

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của angular/angularfire

Tất cả issue của angular/angularfire

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.