Firebase-tools: Tak dapat menyetel konfigurasi properti #<object>yang hanya memiliki pengambil</object>

Dibuat pada 28 Mei 2020  ·  35Komentar  ·  Sumber: firebase/firebase-tools

[WAJIB] Info lingkungan

firebase-tools: 8.4.0

Platform: Windows

[WAJIB] Kasus uji

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);

});

[WAJIB] Langkah untuk mereproduksi

emulasi awal bekerja dengan baik
penerapan awal dan selanjutnya berfungsi dengan baik
fungsinya bekerja dengan baik dalam produksi
tidak dapat meniru secara lokal lagi.

Keluaran konsol:

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.

Selain masalah ini, tidak jelas dari output apa yang terjadi. Tidak ada di log debug.

[REQUIRED] Perilaku yang diharapkan


Emulator dimulai

[REQUIRED] Perilaku sebenarnya


Emulator gagal memulai

emulator-suite functions bug

Komentar yang paling membantu

Perbaikan baru saja dirilis dalam versi 8.4.1 dari firebase-tools

Semua 35 komentar

@ boddy33 ya ok itu sangat aneh. Apakah benar-benar tidak ada lagi yang lain firebase-debug.log ? Atau jika Anda menjalankan perintah dengan --debug ?

Sepertinya ini adalah bug dalam runtime emulator.

[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

Sepertinya ini masalah dengan v8.xx Menurunkan versi ke v7.16.2 berfungsi.

Saya merasa ini mungkin terkait dengan rilis firebase-functions hari ini:
https://github.com/firebase/firebase-functions/releases/tag/v3.6.2

Saya harus menjadi sesuatu yang sangat baru. Melihat masalah lain, emulator v8.xx berfungsi di beberapa titik (dan v8.4.0 dirilis seminggu yang lalu).

Hai,
memiliki masalah yang sama :)

terima kasih @ uditha-atukorala berhasil :)

saat Anda menginstal paket [email protected] lalu
Permintaan HTTP berhasil untuk saya

Perbaikan akan datang pada # 2302 ... jika disetujui dan digabungkan, kami akan mencoba merilisnya secepatnya

Mengalami masalah yang sama persis. macOS

ini membuat saya bingung selama beberapa jam terakhir. Saya memiliki index.js sama seperti @ boddy33 dan itu bahkan terjadi ketika index.js kosong. Ini firebase-debug.log saya:

[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.

kami menunggu dengan rasa ingin tahu untuk persetujuan

Perbaikan baru saja dirilis dalam versi 8.4.1 dari firebase-tools

terima kasih untuk itu ... tepat pada waktunya

divalidasi. Terima kasih.

Halo
Sekitar 2 hari yang lalu saya menggunakan fungsi dan semuanya berjalan tanpa masalah, sayangnya sejak kemarin saya tidak dapat melakukan penerapan. Saya memiliki paket yang cukup lama:

    "firebase": "^5.9.2",
    "firebase-admin": "~8.9.0",
    "firebase-functions": "^3.3.0",
    "firebase-tools": "^4.0.0",

dan saya mendapatkan yang berikut:
image

tetapi dapat menjalankan fungsi secara lokal (--serve).

Hari ini saya telah memperbarui semua dependensi ke versi yang lebih baru, yang secara teori harus menyertakan hotfix, tetapi sayangnya sekarang saya mendapatkan bug baru, sama seperti dalam masalah ini.

    "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.

Saya tidak dapat menerapkan fungsi, tetapi saya bahkan tidak dapat menjalankannya secara lokal karena masalah yang sama.

Perbaikan baru saja dirilis dalam versi 8.4.1 dari firebase-tools

Haruskah fungsi saya diterapkan dengan benar jika saya memiliki versi terbaru?

@amrizal
Tidak yakin apakah masalah ini harus ditutup.

@jakubjodelka dapatkah Anda mencoba membersihkan map node_modules dan menjalankan npm install lagi? Jika ini terus terjadi untuk Anda setelah itu dan dengan firebase --version menunjukkan 8.4.1 beri tahu saya.

Terima kasih. Bekerja untukku sekarang.

[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"}}  `

Saya masih mengerti. Saya melakukan semua hal di atas, ada pemikiran?

image

@COFFEEEADDICT periksa apakah firebase --version menunjukkan 8.4.1

Hai kawan,

Saya telah menerima kesalahan ini setelah pembaruan dalam paket firebase-functions (3.6.2).

Dalam kasus saya, solusinya adalah menghapus /node_modules dan menurunkan firebase-functions ke versi sebelumnya ( npm install --save [email protected] ).

Hallo teman-teman,

Pemeriksaan pertama yang Anda instal versi saya adalah 8.1.1
Perbarui firebase-tools dengan menelepon

sudo npm i -g firebase-tools

Ini akan menginstal versi terbaru 8.4.1
Dan itu memperbaiki masalah saya.
Sebenarnya, saya telah menginstal fungsi firebase dan admin terbaru
"firebase-admin": "8.12.1",
"firebase-functions": "3.6.1",

Saya harap Anda telah memperbaiki masalahnya.

bekerja, terima kasih @iamsrujal

Saya masih mendapatkan bantuan untuk masalah ini?

Sistem
Mac OS Catalina: 10.15.4
Node: v10.21.0
Java: openjdk versi "14.0.1" 2020-04-14

Versi Paket:
"firebase-admin": "^ 8.12.1",
"firebase-functions": "^ 3.7.0",
[email protected]

Perintah yang saya jalankan:
firebase emulators: start --only functions

Keluaran Konsol:
i Memulai emulator: ["functions"]
✔ fungsi: Menggunakan node @ 10 dari host.
✔ fungsi: Emulator dimulai di http: // localhost : 5001
i functions: Menonton "/ Users / chamika / Projects / Bitsmedia / Muslim-Pro-Firebase / functions" untuk Cloud Functions ...
⚠ TypeError: Tidak dapat menyetel konfigurasi properti #yang hanya memiliki pengambil
di InitializeFunctionsConfigHelper (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:328:15)
di /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:448:13
di Generator.next ()
di /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:7:71
di Janji baru ()
di __awaiter (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:3:12)
di main (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:421:12)
di Object.(/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:511:5)
di Module._compile (internal / modules / cjs / loader.js: 778: 30)
di Object.Module._extensions..js (internal / modules / cjs / loader.js: 789: 10)
⚠ Fungsi Anda dimatikan karena memunculkan kesalahan yang tidak tertangani.

Saya mengalami masalah yang sama dan tidak hilang bahkan setelah memperbarui firebase-tools. Saat saya mencoba menjalankan emulator, gagal. Di firebase-debug.log itu menunjukkan:

[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.

Bagaimana cara memperbaikinya? Benar-benar terjebak di sini ...

Bagi mereka yang masih mengalami masalah ini: jika Anda dapat mereproduksi masalah ini pada proyek yang baru diinisialisasi dengan cara yang dapat kami salin, ajukan masalah baru dan kami akan mencobanya.

Jika itu membantu siapa pun: Saya harus menggunakan versi eksplisit untuk meningkatkan alat dan kemudian masalahnya hilang:
sudo npm i -g [email protected]

Sistem
Mac OS Catalina: 10.15.4
Node: v10.21.0
Java: openjdk versi "14.0.1" 2020-04-14

Perbarui pada 09/07/2020 masalah ini masih ada saat menggunakan "firebase-admin": "^8.10.0", .
Saya harus memperbarui ke "firebase-admin": "^8.12.1", dan memeriksa ulang apakah saya memiliki `" firebase-tools ":" 8.4.1 "

Penyiapan yang sama seperti JohnGeorgiadis. Permasalahan yang sama...

functions: Cannot set property config of #<Object> which has only a getter ⚠ Your function was killed because it raised an unhandled error.

Bermain-main dengan versi berbeda dari berbagai dependensi hingga tanpa penyelesaian.

Mungkin ini berguna untuk seseorang: Linux saya menggunakan "/usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js" setiap kali saya mengetik "firebase" di konsol, jadi Linux menggunakan 7.12. 0 versi paket. Saya mengubah tautan simbolik, dan sekarang saya yakin bahwa saya menggunakan versi 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

Kata _local_ adalah kuncinya

Penginstalan global akan menginstal firebase-tools di '/ usr / local / lib / node_modules'. Namun, masalah yang disorot oleh OP menunjuk ke jalur yang berbeda: '/ usr / lib / node_modules / firebase-tools /'.
Di jalur pertama saya memiliki versi terbaru firebase-tools 8.6.0, tetapi versi 7.0.2 di jalur kedua.

Firebase -V menghasilkan 7.0.2

Ini adalah komentar yang relevan (dari diskusi di sini: 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.

Apa yang berhasil bagi saya adalah npm uninstall firebase-tools , lalu memastikan saya telah menginstal versi terbaru dengan -g . Sekarang firebase -V menunjuk ke jalur yang benar dengan versi terbaru, dan emulator firebase berjalan dengan lancar.

Jika itu membantu, saya mengalami konflik antara npm global saya [email protected] dan benang global saya [email protected] . Menghapus versi npm global saya memperbaiki masalah pengembalian 7.0.0 dari firebase -V

Saya mendapatkan kesalahan di atas karena versi node berbeda yang digunakan selama

  1. inisiasi proyek (firebase init) => versi node => v8.xx
  2. proyek berjalan (firebase emulators: start) => node version => v12.xx

Saya memecahkan masalah dengan membuat versi node yang sama

Mungkin ini berguna untuk seseorang: Linux saya menggunakan "/usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js" setiap kali saya mengetik "firebase" di konsol, jadi Linux menggunakan 7.12. 0 versi paket. Saya mengubah tautan simbolik, dan sekarang saya yakin bahwa saya menggunakan versi 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

Kata _local_ adalah kuncinya

Bagaimana cara membatalkan sudo rm firebase

Mungkin ini berguna untuk seseorang: Linux saya menggunakan "/usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js" setiap kali saya mengetik "firebase" di konsol, jadi Linux menggunakan 7.12. 0 versi paket. Saya mengubah tautan simbolik, dan sekarang saya yakin bahwa saya menggunakan versi 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

Kata _local_ adalah kuncinya

Bagaimana cara membatalkan sudo rm firebase

Anda tidak bisa (dengan mudah). Saya akan mencoba menemukan biner dan tempat yang serupa di jalur yang sama

Apakah halaman ini membantu?
0 / 5 - 0 peringkat