Skip to content

Commit c899085

Browse files
authored
Enable source map support for firebase functions (#45)
1 parent a18b717 commit c899085

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed

pnpm-lock.yaml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/api/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"firebase-functions": "^6.3.0",
3030
"nocache": "^4.0.0",
3131
"remeda": "^2.20.0",
32+
"source-map-support": "^0.5.21",
3233
"zod": "^3.24.1"
3334
},
3435
"devDependencies": {
@@ -40,6 +41,7 @@
4041
"@types/cors": "^2.8.17",
4142
"@types/express": "^5.0.0",
4243
"@types/node": "^22.10.10",
44+
"@types/source-map-support": "^0.5.10",
4345
"bunchee": "^6.6.0",
4446
"del-cli": "^6.0.0",
4547
"eslint": "^9.19.0",

services/api/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,11 @@
44
*/
55
import "firebase-functions/logger/compat";
66

7+
/**
8+
* Firebase functions still do not support native source maps, so we need to
9+
* install source-map-support to get stack traces in error reporting.
10+
*/
11+
import sourceMapSupport from "source-map-support";
12+
sourceMapSupport.install();
13+
714
export * from "./server";

services/fns/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"firebase-admin": "^13.0.2",
3030
"firebase-functions": "^6.3.0",
3131
"nocache": "^4.0.0",
32-
"remeda": "^2.20.0"
32+
"remeda": "^2.20.0",
33+
"source-map-support": "^0.5.21"
3334
},
3435
"devDependencies": {
3536
"@codecompose/typescript-config": "^1.2.0",
@@ -39,6 +40,7 @@
3940
"@types/cors": "^2.8.17",
4041
"@types/express": "^5.0.0",
4142
"@types/node": "^22.10.10",
43+
"@types/source-map-support": "^0.5.10",
4244
"bunchee": "^6.6.0",
4345
"del-cli": "^6.0.0",
4446
"eslint": "^9.19.0",

services/fns/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,11 @@
99
*/
1010
import "firebase-functions/logger/compat";
1111

12+
/**
13+
* Firebase functions still do not support native source maps, so we need to
14+
* install source-map-support to get stack traces in error reporting.
15+
*/
16+
import sourceMapSupport from "source-map-support";
17+
sourceMapSupport.install();
18+
1219
export * from "./update-counter";

0 commit comments

Comments
 (0)