firebase-tools : 8.4.0
ํ๋ซํผ : Windows
index.js
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
exports.testFunction = functions.https.onRequest(async (req, res) => {
console.log(req.body);
});
์ด๊ธฐ ์๋ฎฌ๋ ์ดํธ๊ฐ ์ ์๋ํ์ต๋๋ค.
์ด๊ธฐ ๋ฐ ํ์ ๋ฐฐํฌ๊ฐ ์ ์๋ํฉ๋๋ค.
์ด ๊ธฐ๋ฅ์ ํ๋ก๋์
์์ ์ ์๋ํฉ๋๋ค.
๋ ์ด์ ๋ก์ปฌ์์ ์๋ฎฌ๋ ์ด์
ํ ์ ์์ต๋๋ค.
์ฝ์ ์ถ๋ ฅ :
i emulators: Starting emulators: functions
+ functions: Using node<strong i="23">@10</strong> from host.
i functions: Watching "D:\path\to\functions" for Cloud Functions...
! functions: Cannot set property config of #<Object> which has only a getter
! Your function was killed because it raised an unhandled error.
์ด ๋ฌธ์ ์ธ์๋ ์ด๋ค ์ผ์ด ๋ฐ์ํ๋์ง ์ถ๋ ฅ์์ โโ๋ช ํํ์ง ์์ต๋๋ค. ๋๋ฒ๊ทธ ๋ก๊ทธ์ ์๋ฌด๊ฒ๋ ์์ต๋๋ค.
์๋ฎฌ๋ ์ดํฐ ์์
์๋ฎฌ๋ ์ดํฐ๊ฐ ์์๋์ง ์์
@ boddy33 ์ด, ์ ๋ง ์ด์ํฉ๋๋ค. firebase-debug.log
์ธ์๋ ์๋ฌด๊ฒ๋ ์์ต๋๊น? ๋๋ --debug
?
์๋ฎฌ๋ ์ดํฐ ๋ฐํ์์ ๋ฒ๊ทธ ์ธ ๊ฒ ๊ฐ์ต๋๋ค.
[debug] [2020-05-28T19:48:29.510Z] ----------------------------------------------------------------------
[debug] [2020-05-28T19:48:29.511Z] Command: /path/to/node-v12.16.3-darwin-x64/bin/node /path/to/node/bin/firebase functions:shell
[debug] [2020-05-28T19:48:29.511Z] CLI Version: 8.4.0
[debug] [2020-05-28T19:48:29.512Z] Platform: darwin
[debug] [2020-05-28T19:48:29.512Z] Node Version: v12.16.3
[debug] [2020-05-28T19:48:29.512Z] Time: Thu May 28 2020 20:48:29 GMT+0100 (British Summer Time)
[debug] [2020-05-28T19:48:29.512Z] ----------------------------------------------------------------------
[debug] [2020-05-28T19:48:29.512Z]
[debug] [2020-05-28T19:48:29.518Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-05-28T19:48:29.519Z] > authorizing via signed-in user
[debug] [2020-05-28T19:48:29.519Z] [iam] checking project firebase-project for permissions ["firebase.projects.get"]
[debug] [2020-05-28T19:48:29.521Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/firebase-project:testIamPermissions
{"permissions":["firebase.projects.get"]}
[debug] [2020-05-28T19:48:30.208Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Thu, 28 May 2020 19:48:30 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=563","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[warn] โ Your requested "node" version "10" doesn't match your global version "12" {"metadata":{"emulator":{"name":"functions"},"message":"Your requested \"node\" version \"10\" doesn't match your global version \"12\""}}
[debug] [2020-05-28T19:48:30.226Z] [functions] Watching "/path/to/app" for Cloud Functions...
[debug] [2020-05-28T19:48:30.233Z] DEBUG: [worker-pool] addWorker(~diagnostic~)
[debug] [2020-05-28T19:48:30.234Z] DEBUG: [worker-pool] Adding worker with key ~diagnostic~, total=1
[debug] [2020-05-28T19:48:30.234Z] DEBUG: [worker-pool] submitWork(triggerId=)
[debug] [2020-05-28T19:48:30.234Z] DEBUG: [worker-~diagnostic~-2336cd45-d0fd-4176-8826-39b0820a42c8]: Assigning socketPath: /var/folders/5v/7080hjcx6vb_d52z1clvxqd80000gn/T/fire_emu_24604.sock
[debug] [2020-05-28T19:48:30.234Z] DEBUG: [worker-~diagnostic~-2336cd45-d0fd-4176-8826-39b0820a42c8]: BUSY
[debug] [2020-05-28T19:48:30.430Z] DEBUG: [runtime-status] [24604] Functions runtime initialized. {"cwd":"/path/to/app","node_version":"12.16.3"}
[debug] [2020-05-28T19:48:30.431Z] DEBUG: [runtime-status] [24604] Disabled runtime features: undefined
[debug] [2020-05-28T19:48:30.434Z] DEBUG: [runtime-status] [24604] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.12.1","resolution":"/path/to/app/node_modules/firebase-admin/lib/index.js"}
[debug] [2020-05-28T19:48:30.440Z] DEBUG: [runtime-status] [24604] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.6.2","resolution":"/path/to/app/node_modules/firebase-functions/lib/index.js"}
[debug] [2020-05-28T19:48:30.441Z] DEBUG: [runtime-status] [24604] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}]
[debug] [2020-05-28T19:48:30.499Z] DEBUG: [runtime-status] [24604] Checked functions.config() {"config":{}}
[debug] [2020-05-28T19:48:30.499Z] DEBUG: [runtime-status] [24604] Error in handleMessage: {"frb":{"cwd":"/path/to/app","projectId":"firebase-project","triggerId":"","emulators":{},"socketPath":"/var/folders/5v/7080hjcx6vb_d52z1clvxqd80000gn/T/fire_emu_24604.sock"},"opts":{"nodeBinary":"/path/to/node-v12.16.3-darwin-x64/bin/node"}} => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
at /path/to/node-v12.16.3-darwin-x64/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:455:19
at Generator.next (<anonymous>)
at fulfilled (/path/to/node-v12.16.3-darwin-x64/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[warn] โ functions: Cannot set property config of #<Object> which has only a getter {"metadata":{"emulator":{"name":"functions"},"message":"Cannot set property config of #<Object> which has only a getter"}}
[warn] โ Your function was killed because it raised an unhandled error. {"metadata":{"emulator":{"name":"functions"},"message":"Your function was killed because it raised an unhandled error."}}
[debug] [2020-05-28T19:48:30.504Z] DEBUG: [worker-~diagnostic~-2336cd45-d0fd-4176-8826-39b0820a42c8]: exited
[debug] [2020-05-28T19:48:30.504Z] DEBUG: [worker-~diagnostic~-2336cd45-d0fd-4176-8826-39b0820a42c8]: FINISHED
v8.xx์์ v7.16.2๋ก ๋ค์ด ๊ทธ๋ ์ด๋๊ฐ ์๋ํ๋ ๋ฌธ์ ์ธ ๊ฒ ๊ฐ์ต๋๋ค.
์ด๊ฒ์ด ์ค๋์ firebase-functions ๋ฆด๋ฆฌ์ค์ ๊ด๋ จ์ด ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
https://github.com/firebase/firebase-functions/releases/tag/v3.6.2
๋๋ ์์ฃผ ์ต๊ทผ์ ๊ฒ์ด์ด์ผํ๋ค. ๋ค๋ฅธ ๋ฌธ์ ๋ฅผ ์ดํด๋ณด๋ฉด v8.xx ์๋ฎฌ๋ ์ดํฐ๊ฐ ์ด๋ ์์ ์์ ์๋ํ๊ณ ์์์ต๋๋ค (๊ทธ๋ฆฌ๊ณ v8.4.0์ ์ผ์ฃผ์ผ ์ ์ ์ถ์๋์์ต๋๋ค).
์๋
ํ์ธ์,
๊ฐ์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค :)
๊ฐ์ฌํฉ๋๋ค @ uditha-atukorala ๊ทธ๊ฒ์ ์๋ํฉ๋๋ค :)
[email protected] ํจํค์ง๋ฅผ ์ค์นํ๋ฉด
HTTP ์์ฒญ์ด ๋๋ฅผ ์ํด ์๋ํฉ๋๋ค.
์์ ์ # 2302์ ์ ๊ณต๋ฉ๋๋ค ... ์น์ธ ๋ฐ ๋ณํฉ๋๋ฉด ์ต๋ํ ๋นจ๋ฆฌ ๋ฆด๋ฆฌ์คํ๋ ค๊ณ ํฉ๋๋ค.
๋๊ฐ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค. ๋งฅ OS
์ด๊ฒ์ ์ง๋ ๋ช ์๊ฐ ๋์ ์ ๋ฅผ ๋นํฉํ๊ฒํ์ต๋๋ค. @ boddy33 ๊ณผ ๋์ผํ index.js
์์ผ๋ฉฐ index.js๊ฐ ๋น์ด์์ ๋๋ ๋ฐ์ํฉ๋๋ค. ๋ค์์ ๋ด firebase-debug.log์
๋๋ค.
[debug] [2020-05-28T19:54:42.206Z] [runtime-status] [27226] Checked functions.config() {"config":{}}
[debug] [2020-05-28T19:54:42.206Z] [runtime-status] [27226] Error in handleMessage: {"frb":{"cwd":"/Users/aprilpolubiec/Documents/my-project/functions","projectId":"my-project","triggerId":"","emulators":{},"socketPath":"/var/folders/sh/fsnv9b8n29713r9d3kj_7w4c0000gn/T/fire_emu_27226.sock"},"opts":{"nodeBinary":"/Users/aprilpolubiec/.nvm/versions/node/v13.7.0/bin/node"}} => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
at /Users/aprilpolubiec/.nvm/versions/node/v13.7.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:457:19
at Generator.next (<anonymous>)
at fulfilled (/Users/aprilpolubiec/.nvm/versions/node/v13.7.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[warn] โ functions: Cannot set property config of #<Object> which has only a getter
[warn] โ Your function was killed because it raised an unhandled error.
์ฐ๋ฆฌ๋ ์น์ธ์ ๊ธฐ๋ค๋ฆฌ๊ณ ์์ต๋๋ค
ํฝ์ค๋ 8.4.1
์ firebase-tools
8.4.1
๋ฒ์ ์์ ๋ฐฉ๊ธ ๋ฆด๋ฆฌ์ค๋์์ต๋๋ค.
๊ฐ์ฌํฉ๋๋ค ... ์ ์๊ฐ์
ํ์ธ๋์์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค.
์๋
ํ์ธ์
์ฝ 2 ์ผ ์ ์ ํจ์๋ฅผ ๋ฐฐํฌํ๊ณ ์์๋๋ฐ ๋ชจ๋ ๊ฒ์ด ๋ฌธ์ ์์ด ์งํ๋์์ต๋๋ค. ์์ฝ๊ฒ๋ ์ด์ ๋ถํฐ ๋ฐฐํฌ ํ ์ ์์์ต๋๋ค. ๊ฝค ์ค๋๋ ํจํค์ง๊ฐ ์์ต๋๋ค.
"firebase": "^5.9.2",
"firebase-admin": "~8.9.0",
"firebase-functions": "^3.3.0",
"firebase-tools": "^4.0.0",
๊ทธ๋ฆฌ๊ณ ๋๋ ๋ค์์ ์ป์์ต๋๋ค.
ํ์ง๋ง ๋ก์ปฌ์์ ํจ์๋ฅผ ์คํํ ์์์์ต๋๋ค (--serve).
์ค๋ ์ ๋ ๋ชจ๋ ์ข ์์ฑ์ ์ด๋ก ์ ํซํฝ์ค๋ฅผ ํฌํจํด์ผํ๋ ์ต์ ๋ฒ์ ์ผ๋ก ์ ๋ฐ์ดํธํ์ง๋ง ์ํ๊น๊ฒ๋ ์ด์ ์ด ๋ฌธ์ ์์์ ๋์ผํ ์๋ก์ด ๋ฒ๊ทธ๊ฐ ๋ฐ์ํ์ต๋๋ค.
"firebase": "^7.14.5",
"firebase-admin": "~8.10.0",
"firebase-functions": "^3.6.2",
"firebase-tools": "^8.4.1",
[2020-05-29T09:30:46.002Z] [runtime-status] [42525] Error in handleMessage: {"frb":{"cwd":"/Users/jakub.jodelka/xxxProject/backend","projectId":"xxxProject","triggerId":"","emulators":{},"socketPath":"/var/folders/nj/4g6vwdm90bl4tmktf8hpn__00000gp/T/fire_emu_42525.sock"},"opts":{"nodeBinary":"/usr/local/bin/firebase"}} => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
at /Users/jakub.jodelka/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:455:19
at Generator.next (<anonymous>)
at fulfilled (/Users/jakub.jodelka/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
โ functions: Cannot set property config of #<Object> which has only a getter
โ Your function was killed because it raised an unhandled error.
๊ธฐ๋ฅ์ ๋ฐฐํฌ ํ ์๋ ์์ง๋ง ๊ฐ์ ๋ฌธ์ ๋ก ์ธํด ๋ก์ปฌ์์ ์คํํ ์๋ ์์ต๋๋ค.
์ด ์์ ์
8.4.1
์firebase-tools
8.4.1
๋ฒ์ ์์ ๋ฐฉ๊ธ ๋ฆด๋ฆฌ์ค๋์์ต๋๋ค.
์ต์ ๋ฒ์ ์ด์๋ ๊ฒฝ์ฐ ๋ด ํจ์๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ๋ฐฐํฌ๋์ด์ผํฉ๋๊น?
@samtstern ^
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํด์ผํ๋์ง ํ์คํ์ง ์์ต๋๋ค.
@jakubjodelka node_modules
ํด๋๋ฅผ ์ง์ฐ๊ณ npm install
๋ค์ ์คํํ ์ ์์ต๋๊น? ์ด ๋ฌธ์ ๊ฐ ๊ณ์ ๋ฐ์ํ๊ณ firebase --version
8.4.1
ํ์๋๋ฉด ์๋ ค์ฃผ์ธ์.
๊ฐ์ฌ. ์ง๊ธ ๋๋ฅผ ์ํด ์ผํ๊ณ ์์ต๋๋ค.
[2020-05-29T14:38:16.042Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2020-05-29T14:38:16.043Z] > authorizing via signed-in user
[2020-05-29T14:38:16.044Z] [iam] checking project bryn-todoapp-27e80 for permissions ["firebase.projects.get"]
[2020-05-29T14:38:16.047Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/bryn-todoapp-27e80:testIamPermissions
{"permissions":["firebase.projects.get"]}
[2020-05-29T14:38:16.314Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Fri, 29 May 2020 14:38:16 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=117","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-05-29T14:38:16.316Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/bryn-todoapp-27e80
[2020-05-29T14:38:16.590Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Fri, 29 May 2020 14:38:16 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
=== Serving from 'C:\Users\Bryn\Desktop\bryn-todoapp'...
+ functions: Using node<strong i="5">@10</strong> from host. {"metadata":{"emulator":{"name":"functions"},"message":"Using node<strong i="6">@10</strong> from host."}}
i functions: Watching "C:\Users\Bryn\Desktop\bryn-todoapp\functions" for Cloud Functions... {"metadata":{"emulator":{"name":"functions"},"message":"Watching \"C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions\" for Cloud Functions..."}}
[2020-05-29T14:38:18.632Z] [worker-pool] addWorker(~diagnostic~) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(~diagnostic~)"}}
[2020-05-29T14:38:18.638Z] [worker-pool] Adding worker with key ~diagnostic~, total=1 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key ~diagnostic~, total=1"}}
[2020-05-29T14:38:18.638Z] [worker-pool] submitWork(triggerId=) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitWork(triggerId=)"}}
[2020-05-29T14:38:18.639Z] [worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: Assigning socketPath: \\?\pipe\C:\Users\Bryn\Desktop\bryn-todoapp\functions\14372 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: Assigning socketPath: \\\\?\\pipe\\C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions\\14372"}}
[2020-05-29T14:38:18.640Z] [worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]:
BUSY"}}
[2020-05-29T14:38:18.955Z] [runtime-status] [14372] Functions runtime initialized. {"cwd":"C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions","node_version":"10.10.0"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Functions runtime initialized. {\"cwd\":\"C:\\\\Users\\\\Bryn\\\\Desktop\\\\bryn-todoapp\\\\functions\",\"node_version\":\"10.10.0\"}"}}
[2020-05-29T14:38:18.957Z] [runtime-status] [14372] Disabled runtime features: undefined {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Disabled runtime features: undefined"}}
[2020-05-29T14:38:18.960Z] [runtime-status] [14372] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.12.1","resolution":"C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions\\node_modules\\firebase-admin\\lib\\index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"8.12.1\",\"resolution\":\"C:\\\\Users\\\\Bryn\\\\Desktop\\\\bryn-todoapp\\\\functions\\\\node_modules\\\\firebase-admin\\\\lib\\\\index.js\"}"}}
[2020-05-29T14:38:18.961Z] [runtime-status] [14372] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.6.2","resolution":"C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions\\node_modules\\firebase-functions\\lib\\index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.6.2\",\"resolution\":\"C:\\\\Users\\\\Bryn\\\\Desktop\\\\bryn-todoapp\\\\functions\\\\node_modules\\\\firebase-functions\\\\lib\\\\index.js\"}"}}
! functions: Your GOOGLE_APPLICATION_CREDENTIALS environment variable points to /home/user/Downloads/[bryn-todoapp-27e80-firebase-adminsdk-gp1c1-8bc2ce2561].json. Non-emulated services will access production using these credentials. Be careful! {"metadata":{"emulator":{"name":"functions"},"message":"Your GOOGLE_APPLICATION_CREDENTIALS environment variable points to /home/user/Downloads/[bryn-todoapp-27e80-firebase-adminsdk-gp1c1-8bc2ce2561].json. Non-emulated services will access production using these credentials. Be careful!"}}
[2020-05-29T14:38:18.974Z] [runtime-status] [14372] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}] {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Outgoing network have been stubbed. [{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"net\",\"status\":\"mocked\"}]"}}
[2020-05-29T14:38:19.003Z] [runtime-status] [14372] Checked functions.config() {"config":{}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Checked functions.config() {\"config\":{}}"}}
[2020-05-29T14:38:19.009Z] [runtime-status] [14372] Error in handleMessage: {"frb":{"cwd":"C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions","projectId":"bryn-todoapp-27e80","triggerId":"","emulators":{},"socketPath":"\\\\?\\pipe\\C:\\Users\\Bryn\\Desktop\\bryn-todoapp\\functions\\14372"},"opts":{"nodeBinary":"C:\\Program Files\\nodejs\\node.exe"}} => TypeError: Cannot set property config of #<Object> which has
only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
at C:\Users\Bryn\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:455:19
at Generator.next (<anonymous>)
at fulfilled (C:\Users\Bryn\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:5:58)
at process._tickCallback (internal/process/next_tick.js:68:7) {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [14372] Error in handleMessage: {\"frb\":{\"cwd\":\"C:\\\\Users\\\\Bryn\\\\Desktop\\\\bryn-todoapp\\\\functions\",\"projectId\":\"bryn-todoapp-27e80\",\"triggerId\":\"\",\"emulators\":{},\"socketPath\":\"\\\\\\\\?\\\\pipe\\\\C:\\\\Users\\\\Bryn\\\\Desktop\\\\bryn-todoapp\\\\functions\\\\14372\"},\"opts\":{\"nodeBinary\":\"C:\\\\Program Files\\\\nodejs\\\\node.exe\"}} => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter\n at C:\\Users\\Bryn\\AppData\\Roaming\\npm\\node_modules\\firebase-tools\\lib\\emulator\\functionsEmulatorRuntime.js:455:19\n at Generator.next (<anonymous>)\n
at fulfilled (C:\\Users\\Bryn\\AppData\\Roaming\\npm\\node_modules\\firebase-tools\\lib\\emulator\\functionsEmulatorRuntime.js:5:58)\n at process._tickCallback (internal/process/next_tick.js:68:7)"}}
! functions: Cannot set property config of #<Object> which has only a getter {"metadata":{"emulator":{"name":"functions"},"message":"Cannot set property config of #<Object> which has only a getter"}}
! Your function was killed because it raised an unhandled error. {"metadata":{"emulator":{"name":"functions"},"message":"Your function was killed because it raised an unhandled error."}}
[2020-05-29T14:38:19.019Z] [worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: exited {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: exited"}}
[2020-05-29T14:38:19.029Z] [worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: FINISHED {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-8db31d96-b4d5-4fa2-9230-e536f082a401]: FINISHED"}} `
๋๋ ์์ง๋ ๊ทธ๊ฒ์ ์ป๊ณ ์๋ค ๋๋ ์์ ๋ชจ๋ ๊ฒ์ํ๋ค, ์ด๋ค ์๊ฐ?
@COFFEEEADDICT firebase --version
์ 8.4.1
ํ์ ๋๋์ง ํ์ธํฉ๋๋ค.
์๋ ํ์ธ์ ์ฌ๋ฌ๋ถ,
firebase-functions
ํจํค์ง (3.6.2)๋ฅผ ์
๋ฐ์ดํธ ํ ํ์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
์ ๊ฒฝ์ฐ ํด๊ฒฐ์ฑ
์ /node_modules
์ ์ญ์ ํ๊ณ firebase-functions
์ ์ด์ ๋ฒ์ ( npm install --save [email protected]
)์ผ๋ก ๋ค์ด ๊ทธ๋ ์ด๋ํ๋ ๊ฒ์ด ์์ต๋๋ค.
์๋ ํ์ธ์ ์ฌ๋ฌ๋ถ,
๋ด ๋ฒ์ ์ ์ค์น ํ ์ฒซ ๋ฒ์งธ ํ์ธ์ 8.1.1์
๋๋ค.
๋ค์์ ํธ์ถํ์ฌ firebase-tools๋ฅผ ์
๋ฐ์ดํธํ์ธ์.
sudo npm i -g firebase-tools
์ต์ ๋ฒ์ 8.4.1์ ์ค์นํฉ๋๋ค.
๊ทธ๋ฆฌ๊ณ ๊ทธ๊ฒ์ ๋ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
์ฌ์ค, ์ต์ ํ์ด์ด๋ฒ ์ด์ค ๊ธฐ๋ฅ๊ณผ ๊ด๋ฆฌ์๋ฅผ ์ค์นํ์ต๋๋ค.
"firebase-admin": "8.12.1",
"firebase-functions": "3.6.1",
๋ฌธ์ ๋ฅผ ํด๊ฒฐ ํ์ จ๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
๊ฐ์ฌํฉ๋๋ค @iamsrujal
์ฌ์ ํ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๊น?
์ฒด๊ณ
Mac OS Catalina : 10.15.4
๋
ธ๋ : v10.21.0
์๋ฐ : openjdk ๋ฒ์ "14.0.1"2020-04-14
ํจํค์ง ๋ฒ์ :
"firebase-admin": "^ 8.12.1",
"firebase-functions": "^ 3.7.0",
[email protected]
๋ด๊ฐ ์คํ ํ ๋ช
๋ น :
firebase ์๋ฎฌ๋ ์ดํฐ : start --only ํจ์
์ฝ์ ์ถ๋ ฅ :
i ์๋ฎฌ๋ ์ดํฐ ์์ : [ "ํจ์"]
โ ๊ธฐ๋ฅ : ํธ์คํธ์์ node @ 10 ์ฌ์ฉ.
โ ๊ธฐ๋ฅ : http : // localhost : 5001์์ ์์๋ ์๋ฎฌ๋ ์ดํฐ
i ํจ์ : Cloud Functions์ ๋ํ "/ Users / chamika / Projects / Bitsmedia / Muslim-Pro-Firebase / functions"๋ณด๊ธฐ ...
โ ์ ํ ์ค๋ฅ : #์ ์์ฑ ๊ตฌ์ฑ์ ์ค์ ํ ์ ์์ต๋๋ค.
์ด ๊ฐ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ณ firebase-tools๋ฅผ ์ ๋ฐ์ดํธ ํ ํ์๋ ์ฌ๋ผ์ง์ง ์์ต๋๋ค. ์๋ฎฌ๋ ์ดํฐ๋ฅผ ์คํํ๋ ค๊ณ ํ๋ฉด ์คํจํฉ๋๋ค. firebase-debug.log์ ๋ค์์ด ํ์๋ฉ๋๋ค.
[debug] [2020-06-23T18:50:31.331Z] [runtime-status] [54019] Error in handleMessage: {"frb":{"cwd":"/Users/shaimo-mbp/dev/javascript/CryptoTracker/functions","projectId":"cryptotracker-fa488","triggerId":"","ports":{"firestore":8080},"socketPath":"/var/folders/83/c3hy2yfx53g6_f3bvwcslqcc0000gn/T/fire_emu_54019.sock"},"opts":{"nodeBinary":"/Users/shaimo-mbp/.nvm/versions/node/v10.18.1/bin/node"}} => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
at /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:514:19
at Generator.next (<anonymous>)
at fulfilled (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
[warn] โ functions:
[warn] โ Your function was killed because it raised an unhandled error.
์ด๋ป๊ฒ ๊ณ ์น ์ ์์ต๋๊น? ์ฌ๊ธฐ์ ์์ ํ ๋ถ์ด ...
์ด ๋ฌธ์ ๊ฐ ์ฌ์ ํ ๋ฐ์ํ๋ ๊ฒฝ์ฐ : ์๋ก ์ด๊ธฐํ ๋ ํ๋ก์ ํธ ์์ ๋ณต์ฌ ํ ์์๋ ๋ฐฉ์์ผ๋ก์ด ๋ฌธ์ ๋ฅผ ์ฌํ ํ ์์๋ ๊ฒฝ์ฐ ์ ๋ฌธ์ ๋ฅผ ์ ์ถํ๊ณ ์๋ํด ๋ณด๊ฒ ์ต๋๋ค.
๋๊ตฌ์๊ฒ๋ ๋์์ด๋๋ ๊ฒฝ์ฐ : ๋๊ตฌ๋ฅผ ์
๊ทธ๋ ์ด๋ํ๊ธฐ ์ํด ๋ช
์ ์ ๋ฒ์ ์ ์ฌ์ฉํด์ผํ๊ณ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค.
sudo npm i -g [email protected]
์ฒด๊ณ
Mac OS Catalina : 10.15.4
๋
ธ๋ : v10.21.0
์๋ฐ : openjdk ๋ฒ์ "14.0.1"2020-04-14
2020 ๋
9 ์ 7 ์ผ๋ถ๋ก ์
๋ฐ์ดํธํ๋ฉด "firebase-admin": "^8.10.0",
๋ฅผ) ์ฌ์ฉํ๋ ๋์์ด ๋ฌธ์ ๊ฐ ์ฌ์ ํ ์กด์ฌํฉ๋๋ค.
"firebase-admin": "^8.12.1",
๋ก ์
๋ฐ์ดํธํ๊ณ ` "firebase-tools": "8.4.1"์ด ์๋์ง ๋ค์ ํ์ธํด์ผํ์ต๋๋ค.
JohnGeorgiadis์ ๋์ผํ ์ค์ . ๊ฐ์ ๋ฌธ์ ...
functions: Cannot set property config of #<Object> which has only a getter
โ Your function was killed because it raised an unhandled error.
ํด๊ฒฐ๋์ง ์๋ ๋ค์ํ ์ข ์์ฑ์ ๋ค๋ฅธ ๋ฒ์ ์ผ๋ก ๋์์ต๋๋ค.
์๋ง๋ ์ด๊ฒ์ ๋๊ตฐ๊ฐ์๊ฒ ๋์์ด ๋ ๊ฒ์ ๋๋ค. ๋ด ๋ฆฌ๋ ์ค๋ ์ฝ์์ "firebase"๋ฅผ ์ ๋ ฅ ํ ๋๋ง๋ค "/usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js"๋ฅผ ์ฌ์ฉํ๊ณ ์์์ผ๋ฏ๋ก 7.12๋ฅผ ์ฌ์ฉํ๊ณ ์์์ต๋๋ค. 0 ๋ฒ์ ์ ํจํค์ง. ์ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ๋ณ๊ฒฝํ์ผ๋ฉฐ ์ด์ 8.6.0 ๋ฒ์ ์ ์ฌ์ฉํ๊ณ ์๋ค๊ณ ํ์ ํฉ๋๋ค.
user<strong i="6">@machine</strong>: which firebase
/usr/local/bin/firebase
user<strong i="7">@machine</strong>: cd /usr/local/bin
user<strong i="8">@machine</strong>: sudo rm firebase
user<strong i="9">@machine</strong>: sudo ln -s /usr/lib/node_modules/firebase-tools/lib/bin/firebase.js firebase
user<strong i="10">@machine</strong>: firebase --version
8.6.0
_local_์ด๋ผ๋ ๋จ์ด๊ฐ ํต์ฌ์ ๋๋ค.
์ ์ญ ์ค์น๋ '/ usr / local / lib / node_modules'์ firebase-tools๋ฅผ ์ค์นํฉ๋๋ค. ๊ทธ๋ฌ๋ OP๋ก ๊ฐ์กฐ ํ์๋ ๋ฌธ์ ๋ '/ usr / lib / node_modules / firebase-tools /'์ ๊ฐ์ ๋ค๋ฅธ ๊ฒฝ๋ก๋ฅผ ๊ฐ๋ฆฌ ํต๋๋ค.
์ฒซ ๋ฒ์งธ ๊ฒฝ๋ก์๋ ์ต์ ๋ฒ์ ์ firebase-tools 8.6.0์ด ์์ง๋ง ๋ ๋ฒ์งธ ๊ฒฝ๋ก์๋ ๋ฒ์ 7.0.2๊ฐ ์์ต๋๋ค.
firebase -V๊ฐ 7.0.2๋ฅผ ๋ฐํํ์ต๋๋ค.
๋ค์์ ๊ด๋ จ ์๊ฒฌ์ ๋๋ค (์ฌ๊ธฐ ํ ๋ก ์์ : https://stackoverflow.com/q/5926672/7461599).
installing without -g option will install a module to you working directory e.g. if you make a directory say ~/Desktop/tmp then cd ~/Desktop/tmp then do npm install appium then do ls you will see node_modules package-lock.json because you have installed a node module appium to your working directory... super confusing because -g should essentially be the default but is not.
๋๋ฅผ ์ํดํ๋ ๊ฒ์ npm uninstall firebase-tools
์ผ๋ก ๋ง๋ ๋ค์ -g
์ต์ ๋ฒ์ ์ ์ค์นํ๋์ง ํ์ธํ๋ ๊ฒ์ด ์์ต๋๋ค. ์ด์ firebase -V
๊ฐ ์ต์ ๋ฒ์ ์ผ๋ก ์ฌ๋ฐ๋ฅธ ๊ฒฝ๋ก๋ฅผ ๊ฐ๋ฆฌํค๊ณ firebase ์๋ฎฌ๋ ์ดํฐ๊ฐ ์ํํ๊ฒ ์คํ๋ฉ๋๋ค.
๋์์ด๋๋ ๊ฒฝ์ฐ ๊ธ๋ก๋ฒ npm [email protected]
์ ๊ธ๋ก๋ฒ ์ [email protected]
๊ฐ์ ์ถฉ๋์ด์์์ต๋๋ค. ๋ด ๊ธ๋ก๋ฒ npm ๋ฒ์ ์ ์ญ์ ํ๋ฉด firebase -V
์์ 7.0.0
๋ฐํ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค.
๋๋ ๋์ ์ฌ์ฉ ๋ ๋ค๋ฅธ ๋ ธ๋ ๋ฒ์ ์ผ๋ก ์ธํด ์์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
๋์ผํ ๋ ธ๋ ๋ฒ์ ์ ๋ง๋ค์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
์๋ง๋ ์ด๊ฒ์ ๋๊ตฐ๊ฐ์๊ฒ ๋์์ด ๋ ๊ฒ์ ๋๋ค. ๋ด ๋ฆฌ๋ ์ค๋ ์ฝ์์ "firebase"๋ฅผ ์ ๋ ฅ ํ ๋๋ง๋ค "/usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js"๋ฅผ ์ฌ์ฉํ๊ณ ์์์ผ๋ฏ๋ก 7.12๋ฅผ ์ฌ์ฉํ๊ณ ์์์ต๋๋ค. 0 ๋ฒ์ ์ ํจํค์ง. ์ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ๋ณ๊ฒฝํ์ผ๋ฉฐ ์ด์ 8.6.0 ๋ฒ์ ์ ์ฌ์ฉํ๊ณ ์๋ค๊ณ ํ์ ํฉ๋๋ค.
user<strong i="7">@machine</strong>: which firebase /usr/local/bin/firebase user<strong i="8">@machine</strong>: cd /usr/local/bin user<strong i="9">@machine</strong>: sudo rm firebase user<strong i="10">@machine</strong>: sudo ln -s /usr/lib/node_modules/firebase-tools/lib/bin/firebase.js firebase user<strong i="11">@machine</strong>: firebase --version 8.6.0
_local_์ด๋ผ๋ ๋จ์ด๊ฐ ํต์ฌ์ ๋๋ค.
sudo rm firebase๋ฅผ ์คํ ์ทจ์ํ๋ ๋ฐฉ๋ฒ
์๋ง๋ ์ด๊ฒ์ ๋๊ตฐ๊ฐ์๊ฒ ๋์์ด ๋ ๊ฒ์ ๋๋ค. ๋ด ๋ฆฌ๋ ์ค๋ ์ฝ์์ "firebase"๋ฅผ ์ ๋ ฅ ํ ๋๋ง๋ค "/usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js"๋ฅผ ์ฌ์ฉํ๊ณ ์์์ผ๋ฏ๋ก 7.12๋ฅผ ์ฌ์ฉํ๊ณ ์์์ต๋๋ค. 0 ๋ฒ์ ์ ํจํค์ง. ์ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ๋ณ๊ฒฝํ์ผ๋ฉฐ ์ด์ 8.6.0 ๋ฒ์ ์ ์ฌ์ฉํ๊ณ ์๋ค๊ณ ํ์ ํฉ๋๋ค.
user<strong i="8">@machine</strong>: which firebase /usr/local/bin/firebase user<strong i="9">@machine</strong>: cd /usr/local/bin user<strong i="10">@machine</strong>: sudo rm firebase user<strong i="11">@machine</strong>: sudo ln -s /usr/lib/node_modules/firebase-tools/lib/bin/firebase.js firebase user<strong i="12">@machine</strong>: firebase --version 8.6.0
_local_์ด๋ผ๋ ๋จ์ด๊ฐ ํต์ฌ์ ๋๋ค.
sudo rm firebase๋ฅผ ์คํ ์ทจ์ํ๋ ๋ฐฉ๋ฒ
๋น์ ์ (์ฝ๊ฒ) ํ ์ ์์ต๋๋ค. ๋น์ทํ ๋ฐ์ด๋๋ฆฌ๋ฅผ ์ฐพ๊ณ ๊ฐ์ ๊ฒฝ๋ก์ ๋ฐฐ์นํ๋ ค๊ณ ํฉ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
ํฝ์ค๋
8.4.1
์firebase-tools
8.4.1
๋ฒ์ ์์ ๋ฐฉ๊ธ ๋ฆด๋ฆฌ์ค๋์์ต๋๋ค.