@Denioo

Проблема с корсами при отправки в firebase?

Всем привет, когда хочу создать нового юзера вылетает корс ошибка:
spoiler
args.js:98 Uncaught I {code: "auth/argument-error", message: "createUserWithEmailAndPassword failed: Expected 2 arguments but got 1.", a: null}
Ol @ firebase-auth.js:1
i @ firebase-auth.js:1
createUser @ createUser.js:10
combination @ redux.js:459
p @ VM377:1
v @ VM377:1
(anonymous) @ VM377:1
dispatch @ redux.js:213
e @ VM377:1
submitUser @ useRegister.js:23
callCallback @ react-dom.development.js:188
invokeGuardedCallbackDev @ react-dom.development.js:237
invokeGuardedCallback @ react-dom.development.js:292
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:306
executeDispatch @ react-dom.development.js:389
executeDispatchesInOrder @ react-dom.development.js:414
executeDispatchesAndRelease @ react-dom.development.js:3278
executeDispatchesAndReleaseTopLevel @ react-dom.development.js:3287
forEachAccumulated @ react-dom.development.js:3259
runEventsInBatch @ react-dom.development.js:3304
runExtractedPluginEventsInBatch @ react-dom.development.js:3514
handleTopLevel @ react-dom.development.js:3558
batchedEventUpdates$1 @ react-dom.development.js:21871
batchedEventUpdates @ react-dom.development.js:795
dispatchEventForLegacyPluginEventSystem @ react-dom.development.js:3568
attemptToDispatchEvent @ react-dom.development.js:4267
dispatchEvent @ react-dom.development.js:4189
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
discreteUpdates$1 @ react-dom.development.js:21887
discreteUpdates @ react-dom.development.js:806
dispatchDiscreteEvent @ react-dom.development.js:4168
Show 2 more frames
react-dom.development.js:248 Uncaught Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://fb.me/react-crossorigin-error for more information.
    at Object.invokeGuardedCallbackDev (react-dom.development.js:248)
    at invokeGuardedCallback (react-dom.development.js:292)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:306)
    at executeDispatch (react-dom.development.js:389)
    at executeDispatchesInOrder (react-dom.development.js:414)
    at executeDispatchesAndRelease (react-dom.development.js:3278)
    at executeDispatchesAndReleaseTopLevel (react-dom.development.js:3287)
    at forEachAccumulated (react-dom.development.js:3259)
    at runEventsInBatch (react-dom.development.js:3304)
    at runExtractedPluginEventsInBatch (react-dom.development.js:3514)
    at handleTopLevel (react-dom.development.js:3558)
    at batchedEventUpdates$1 (react-dom.development.js:21871)
    at batchedEventUpdates (react-dom.development.js:795)
    at dispatchEventForLegacyPluginEventSystem (react-dom.development.js:3568)
    at attemptToDispatchEvent (react-dom.development.js:4267)
    at dispatchEvent (react-dom.development.js:4189)
    at unstable_runWithPriority (scheduler.development.js:653)
    at runWithPriority$1 (react-dom.development.js:11039)
    at discreteUpdates$1 (react-dom.development.js:21887)
    at discreteUpdates (react-dom.development.js:806)
    at dispatchDiscreteEvent (react-dom.development.js:4168)

Фрагмент кода отвечающего за отправку:
case CREATE_USER:
          window.register.createUserWithEmailAndPassword(action.payload).then(user => {
            console.log(user)
          }).catch((e) => {
            console.log(e)
          })

Из-за чего может быть эта ошибка?
В другом браузере другая ошибка:
uncaught exception: Error: createUserWithEmailAndPassword failed: 2 arguments were expected, but 1 was received
  • Вопрос задан
  • 131 просмотр
Решения вопроса 1
hzzzzl
@hzzzzl
2 arguments were expected, but 1 was received

скорее всего action.payload это объект, а createUserWithEmailAndPassword хочет вызываться как createUserWithEmailAndPassword(email, password)
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы
25 нояб. 2024, в 21:54
20000 руб./за проект
25 нояб. 2024, в 21:39
3000 руб./за проект
25 нояб. 2024, в 21:34
7000 руб./за проект