Skip to content

Commit 918ce57

Browse files
committed
first commit
0 parents  commit 918ce57

11 files changed

+9507
-0
lines changed

.firebaserc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {},
3+
"targets": {},
4+
"etags": {}
5+
}

.gitignore

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
firebase-debug.log*
8+
firebase-debug.*.log*
9+
10+
# Firebase cache
11+
.firebase/
12+
13+
# Firebase config
14+
15+
# Uncomment this if you'd like others to create their own Firebase project.
16+
# For a team working on the same Firebase project(s), it is recommended to leave
17+
# it commented so all members can deploy to the same project(s) in .firebaserc.
18+
# .firebaserc
19+
20+
# Runtime data
21+
pids
22+
*.pid
23+
*.seed
24+
*.pid.lock
25+
26+
# Directory for instrumented libs generated by jscoverage/JSCover
27+
lib-cov
28+
29+
# Coverage directory used by tools like istanbul
30+
coverage
31+
32+
# nyc test coverage
33+
.nyc_output
34+
35+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
36+
.grunt
37+
38+
# Bower dependency directory (https://bower.io/)
39+
bower_components
40+
41+
# node-waf configuration
42+
.lock-wscript
43+
44+
# Compiled binary addons (http://nodejs.org/api/addons.html)
45+
build/Release
46+
47+
# Dependency directories
48+
node_modules/
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional REPL history
57+
.node_repl_history
58+
59+
# Output of 'npm pack'
60+
*.tgz
61+
62+
# Yarn Integrity file
63+
.yarn-integrity
64+
65+
# dotenv environment variables file
66+
.env
67+
68+
# dataconnect generated files
69+
.dataconnect

README.md

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Repro for issue 8100
2+
3+
## Versions
4+
5+
firebase-tools: v13.29.1<br>
6+
node: v22.11.0<br>
7+
8+
## Steps to reproduce
9+
10+
1. Installing dependencies
11+
- Run `cd functions`
12+
- Run `npm i`
13+
- Run `cd ../`
14+
2. Run `firebase deploy --only functions --project PROJECT_ID`
15+
3. Functions is deployed, open "https://us-central1-PROJECT_ID.cloudfunctions.net/helloWorld"
16+
<details>
17+
<summary>function response</summary>
18+
19+
````
20+
{
21+
"custom_field": "This response is from a Firebase Cloud Function!",
22+
"url": "https://api.github.com/repos/firebase/firebase-tools/issues/8100",
23+
"status": 200,
24+
"headers": {
25+
"accept-ranges": "bytes",
26+
"access-control-allow-origin": "*",
27+
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
28+
"cache-control": "public, max-age=60, s-maxage=60",
29+
"content-encoding": "gzip",
30+
"content-length": "2664",
31+
"content-security-policy": "default-src 'none'",
32+
"content-type": "application/json; charset=utf-8",
33+
"date": "Tue, 07 Jan 2025 12:54:16 GMT",
34+
"etag": "W/\"3522502e629d6a190aea05a99d78901e720f9bad7c27a2376a642ff1a214576b\"",
35+
"last-modified": "Mon, 06 Jan 2025 11:08:32 GMT",
36+
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
37+
"server": "github.com",
38+
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
39+
"vary": "Accept,Accept-Encoding, Accept, X-Requested-With",
40+
"x-content-type-options": "nosniff",
41+
"x-frame-options": "deny",
42+
"x-github-api-version-selected": "2022-11-28",
43+
"x-github-media-type": "github.v3; format=json",
44+
"x-github-request-id": "3E25:340964:23A9964:472666D:677D23F8",
45+
"x-ratelimit-limit": "60",
46+
"x-ratelimit-remaining": "59",
47+
"x-ratelimit-reset": "1736258056",
48+
"x-ratelimit-resource": "core",
49+
"x-ratelimit-used": "1",
50+
"x-xss-protection": "0"
51+
},
52+
"data": {
53+
"url": "https://api.github.com/repos/firebase/firebase-tools/issues/8100",
54+
"repository_url": "https://api.github.com/repos/firebase/firebase-tools",
55+
"labels_url": "https://api.github.com/repos/firebase/firebase-tools/issues/8100/labels{/name}",
56+
"comments_url": "https://api.github.com/repos/firebase/firebase-tools/issues/8100/comments",
57+
"events_url": "https://api.github.com/repos/firebase/firebase-tools/issues/8100/events",
58+
"html_url": "https://github.com/firebase/firebase-tools/issues/8100",
59+
"id": 2770375654,
60+
"node_id": "I_kwDOAOsFPM6lIJPm",
61+
"number": 8100,
62+
"title": "Deploy analysis error when importing octokit/rest",
63+
"user": {
64+
"login": "larssn",
65+
"id": 890725,
66+
"node_id": "MDQ6VXNlcjg5MDcyNQ==",
67+
"avatar_url": "https://avatars.githubusercontent.com/u/890725?v=4",
68+
"gravatar_id": "",
69+
"url": "https://api.github.com/users/larssn",
70+
"html_url": "https://github.com/larssn",
71+
"followers_url": "https://api.github.com/users/larssn/followers",
72+
"following_url": "https://api.github.com/users/larssn/following{/other_user}",
73+
"gists_url": "https://api.github.com/users/larssn/gists{/gist_id}",
74+
"starred_url": "https://api.github.com/users/larssn/starred{/owner}{/repo}",
75+
"subscriptions_url": "https://api.github.com/users/larssn/subscriptions",
76+
"organizations_url": "https://api.github.com/users/larssn/orgs",
77+
"repos_url": "https://api.github.com/users/larssn/repos",
78+
"events_url": "https://api.github.com/users/larssn/events{/privacy}",
79+
"received_events_url": "https://api.github.com/users/larssn/received_events",
80+
"type": "User",
81+
"user_view_type": "public",
82+
"site_admin": false
83+
},
84+
"labels": [
85+
{
86+
"id": 71928367,
87+
"node_id": "MDU6TGFiZWw3MTkyODM2Nw==",
88+
"url": "https://api.github.com/repos/firebase/firebase-tools/labels/type:%20bug",
89+
"name": "type: bug",
90+
"color": "fc2929",
91+
"default": false,
92+
"description": ""
93+
},
94+
{
95+
"id": 1135777654,
96+
"node_id": "MDU6TGFiZWwxMTM1Nzc3NjU0",
97+
"url": "https://api.github.com/repos/firebase/firebase-tools/labels/api:%20functions",
98+
"name": "api: functions",
99+
"color": "acc9ef",
100+
"default": false,
101+
"description": ""
102+
}
103+
],
104+
"state": "open",
105+
"locked": false,
106+
"assignee": null,
107+
"assignees": [],
108+
"milestone": null,
109+
"comments": 0,
110+
"created_at": "2025-01-06T10:43:49Z",
111+
"updated_at": "2025-01-06T11:08:32Z",
112+
"closed_at": null,
113+
"author_association": "NONE",
114+
"sub_issues_summary": {
115+
"total": 0,
116+
"completed": 0,
117+
"percent_completed": 0
118+
},
119+
"active_lock_reason": null,
120+
"body": "\u003C!-- DO NOT DELETE\nvalidate_template=true\ntemplate_path=.github/ISSUE_TEMPLATE/bug_report.md\n--\u003E\n\n\u003C!--\nThank you for contributing to the Firebase community!\n\nThink you found a bug?\n=======================\nYeah, we're definitely not perfect! Please use this template and include a minimal repro when opening the issue. If you know how to solve the issue, please create a Pull Request, and we'd be happy to review it!\n\nHave a feature request?\n========================\nGreat, we love hearing how we can improve our products! However, do not use this template to submit a feature request. Please submit your feature requests to: https://firebase.google.com/support/contact/bugs-features/\n\nHave a usage question?\n=======================\nWe get lots of those and we love helping you, but GitHub is not the best place for them and they will be closed. Please take a look at the guide first: https://firebase.google.com/docs/cli/\n\nIf the official documentation doesn't help, try asking through our official support channel: https://firebase.google.com/support/\n\nAdditional locations to check for solutions or assistance from the community:\n- Stack Overflow: https://stackoverflow.com/\n- Firebase Slack Community: https://firebase.community/\n\n*Please avoid duplicate posting across multiple channels!*\n--\u003E\n\n### [REQUIRED] Environment info\n\n\u003C!-- What version of the Firebase CLI (`firebase-tools`) are you using? Note that your issue may already be fixed in the latest versions. The latest version can be found at https://github.com/firebase/firebase-tools/releases --\u003E\n\n\u003C!-- Output of `firebase --version` --\u003E\n\n**firebase-tools: 13.29.1**\n\n\u003C!-- e.g. macOS, Windows, Ubuntu --\u003E\n\n**Platform: macOS**\n\n### [REQUIRED] Test case\n\n\u003C!-- Provide a minimal, complete, and verifiable example (http://stackoverflow.com/help/mcve) --\u003E\nAdd `import { Octokit } from '@octokit/rest'` to your index.ts\n\n### [REQUIRED] Steps to reproduce\n\n- Create a new project.\n- Install Octokit: `npm install @octokit/rest`\n- Import it in your index.ts file: `import { Octokit } from '@octokit/rest'`\n- deploy it: firebase deploy --only functions\n\nAn error will be thrown:\n```\nFirebaseAppError: The default Firebase app already exists. This means you called initializeApp() more than once without providing an app name as the second argument. In most cases you only need to call initializeApp() once. But if you do want to initialize multiple apps, pass a second argument to initializeApp() to give each app a unique name.\n at AppStore.initializeApp (/Users/lars/workspace/tillty/tillty_cloud_functions/functions/node_modules/firebase-admin/lib/app/lifecycle.js:41:23)\n at initializeApp (/Users/lars/workspace/tillty/tillty_cloud_functions/functions/node_modules/firebase-admin/lib/app/lifecycle.js:102:36)\n at Object.\u003Canonymous\u003E (/Users/lars/workspace/tillty/tillty_cloud_functions/functions/src/index.ts:7:14)\n at Module._compile (node:internal/modules/cjs/loader:1358:14)\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1416:10)\n at Module.load (node:internal/modules/cjs/loader:1208:32)\n at Function.Module._load (node:internal/modules/cjs/loader:1024:12)\n at cjsLoader (node:internal/modules/esm/translators:348:17)\n at ModuleWrap.\u003Canonymous\u003E (node:internal/modules/esm/translators:297:7)\n at ModuleJob.run (node:internal/modules/esm/module_job:222:25) {\n errorInfo: {\n code: 'app/duplicate-app',\n message: 'The default Firebase app already exists. This means you called initializeApp() more than once without providing an app name as the second argument. In most cases you only need to call initializeApp() once. But if you do want to initialize multiple apps, pass a second argument to initializeApp() to give each app a unique name.'\n },\n codePrefix: 'app'\n}\n\n\nError: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error\n```\n\nNow remove the import and try again.\n\nIt should deploy successfully.\n\n### [REQUIRED] Expected behavior\n\nI expect Octokit to be usable.\n\n### [REQUIRED] Actual behavior\n\nI think this is a false positive of the code analysis algorithm that runs before deployment.",
121+
"closed_by": null,
122+
"reactions": {
123+
"url": "https://api.github.com/repos/firebase/firebase-tools/issues/8100/reactions",
124+
"total_count": 0,
125+
"+1": 0,
126+
"-1": 0,
127+
"laugh": 0,
128+
"hooray": 0,
129+
"confused": 0,
130+
"heart": 0,
131+
"rocket": 0,
132+
"eyes": 0
133+
},
134+
"timeline_url": "https://api.github.com/repos/firebase/firebase-tools/issues/8100/timeline",
135+
"performed_via_github_app": null,
136+
"state_reason": null
137+
}
138+
}
139+
````
140+
141+
</details>

firebase.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"functions": [
3+
{
4+
"source": "functions",
5+
"codebase": "default",
6+
"ignore": [
7+
"node_modules",
8+
".git",
9+
"firebase-debug.log",
10+
"firebase-debug.*.log",
11+
"*.local"
12+
],
13+
"predeploy": [
14+
"npm --prefix \"$RESOURCE_DIR\" run lint",
15+
"npm --prefix \"$RESOURCE_DIR\" run build"
16+
]
17+
}
18+
]
19+
}

functions/.eslintrc.cjs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
es6: true,
5+
node: true,
6+
},
7+
extends: [
8+
"eslint:recommended",
9+
"plugin:import/errors",
10+
"plugin:import/warnings",
11+
"plugin:import/typescript",
12+
"google",
13+
"plugin:@typescript-eslint/recommended",
14+
],
15+
parser: "@typescript-eslint/parser",
16+
parserOptions: {
17+
project: ["tsconfig.json", "tsconfig.dev.json"],
18+
sourceType: "module",
19+
},
20+
ignorePatterns: [
21+
"/lib/**/*", // Ignore built files.
22+
"/generated/**/*", // Ignore generated files.
23+
],
24+
plugins: [
25+
"@typescript-eslint",
26+
"import",
27+
],
28+
rules: {
29+
"quotes": ["error", "double"],
30+
"import/no-unresolved": 0,
31+
"indent": ["error", 2],
32+
},
33+
};

functions/.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Compiled JavaScript files
2+
lib/**/*.js
3+
lib/**/*.js.map
4+
5+
# TypeScript v1 declaration files
6+
typings/
7+
8+
# Node.js dependency directory
9+
node_modules/
10+
*.local

0 commit comments

Comments
 (0)