Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: error is not defined #7

Closed
zxpectre opened this issue Mar 25, 2021 · 6 comments
Closed

ReferenceError: error is not defined #7

zxpectre opened this issue Mar 25, 2021 · 6 comments

Comments

@zxpectre
Copy link

Hi, for years react-firebaseui-localized has been working fine, but since yesterday, every time I deploy or call npm install, on production and at localhost, this error crash my app's login! Please can anyone help? I haven't change any firebase related version lately, neither related code.

using [email protected]

`
ReferenceError: error is not defined
t.default
node_modules/react-firebaseui-localized/dist/index.js:1

1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("react-firebaseui-localized",["React"],t):"object"==typeof exports?exports["react-firebaseui-localized"]=t(require("react")):e["react-firebaseui-localized"]=t(e.React)}(this,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var u=t[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)r.d(n,u,function(t){return e[t]}.bind(null,u));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),u=r.n(n);var o=function(e){const[t,r]=Object(n.useState)({value:"loading",payload:void 0}),u=Object(n.useRef)();return Object(n.useEffect)(()=>{u.current=document.createElement("script"),u.current.src=e,u.current.async=!0;const t=()=>r({value:"loaded"}),n=e=>{u.current.remove(),r({value:"error",payload:e})};return u.current.addEventListener("load",t),u.current.addEventListener("error",n),document.body.appendChild(u.current),()=>{u.current.removeEventListener("load",t),u.current.removeEventListener("error",n)}},[e]),t};t.default=function({auth:e,config:t,lang:r,version:i,rtl:a,firebase:c}){const f=o(https://www.gstatic.com/firebasejs/ui/${i}/firebase-ui-auth__${r}.js),s=Object(n.useRef)(),l=Object(n.useRef)();return Object(n.useEffect)(()=>{c&&(window.firebase=c)},[]),Object(n.useEffect)(()=>{if("loading"!==f.value){if("error"===f.value)throw f.payload;(async()=>{l.current&&await l.current.delete(),s.current.innerHTML="";(window.firebaseui.auth.AuthUI.getInstance()||new window.firebaseui.auth.AuthUI(e)).start("#firebaseui_container",t),l.current=window.firebase.app("[DEFAULT]-firebaseui-temp")})()}},[e,t,error,loaded]),u.a.createElement(u.a.Fragment,null,u.a.createElement("link",{type:"text/css",rel:"stylesheet",href:https://www.gstatic.com/firebasejs/ui/${i}/firebase-ui-auth${a?"-rtl":""}.css}),u.a.createElement("div",{ref:s,id:"firebaseui_container"}))}}])}));
View compiled
renderWithHooks
node_modules/react-dom/cjs/react-dom.development.js:14803
14800 | }
14801 | }
14802 |
14803 | var children = Component(props, secondArg); // Check if there was a render phase update
| ^ 14804 |
14805 | if (workInProgress.expirationTime === renderExpirationTime) {
14806 | // Keep rendering in a loop for as long as render phase updates continue to
View compiled
mountIndeterminateComponent
node_modules/react-dom/cjs/react-dom.development.js:17482
17479 |
17480 | setIsRendering(true);
17481 | ReactCurrentOwner$1.current = workInProgress;
17482 | value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
| ^ 17483 | setIsRendering(false);
17484 | } // React DevTools reads this flag.
17485 |
View compiled
beginWork
node_modules/react-dom/cjs/react-dom.development.js:18596
18593 | switch (workInProgress.tag) {
18594 | case IndeterminateComponent:
18595 | {
18596 | return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderExpirationTime);
| ^ 18597 | }
18598 |
18599 | case LazyComponent:
View compiled
HTMLUnknownElement.callCallback
node_modules/react-dom/cjs/react-dom.development.js:188
185 | window.event = windowEvent;
186 | }
187 |
188 | func.apply(context, funcArgs);
| ^ 189 | didError = false;
190 | } // Create a global error event handler. We use this to capture the value
191 | // that was thrown. It's possible that this error handler will fire more
View compiled
invokeGuardedCallbackDev
node_modules/react-dom/cjs/react-dom.development.js:237
234 | // errors, it will trigger our global error handler.
235 |
236 | evt.initEvent(evtType, false, false);
237 | fakeNode.dispatchEvent(evt);
| ^ 238 |
239 | if (windowEventDescriptor) {
240 | Object.defineProperty(window, 'event', windowEventDescriptor);
View compiled
invokeGuardedCallback
node_modules/react-dom/cjs/react-dom.development.js:292
289 | function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
290 | hasError = false;
291 | caughtError = null;
292 | invokeGuardedCallbackImpl$1.apply(reporter, arguments);
293 | }
294 | /**
295 | * Same as invokeGuardedCallback, but instead of returning an error, it stores
View compiled
beginWork$1
node_modules/react-dom/cjs/react-dom.development.js:23203
23200 | } // Run beginWork again.
23201 |
23202 |
23203 | invokeGuardedCallback(null, beginWork, null, current, unitOfWork, expirationTime);
| ^ 23204 |
23205 | if (hasCaughtError()) {
23206 | var replayError = clearCaughtError(); // invokeGuardedCallback sometimes sets an expando _suppressLogging.
View compiled
performUnitOfWork
node_modules/react-dom/cjs/react-dom.development.js:22157
22154 | next = beginWork$1(current, unitOfWork, renderExpirationTime$1);
22155 | stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
22156 | } else {
22157 | next = beginWork$1(current, unitOfWork, renderExpirationTime$1);
| ^ 22158 | }
22159 |
22160 | resetCurrentFiber();
View compiled
workLoopSync
node_modules/react-dom/cjs/react-dom.development.js:22130
22127 | function workLoopSync() {
22128 | // Already timed out, so perform work without checking if we need to yield.
22129 | while (workInProgress !== null) {
22130 | workInProgress = performUnitOfWork(workInProgress);
22131 | }
22132 | }
22133 | /** @noinline */
View compiled
performSyncWorkOnRoot
node_modules/react-dom/cjs/react-dom.development.js:21756
21753 |
21754 | do {
21755 | try {
21756 | workLoopSync();
| ^ 21757 | break;
21758 | } catch (thrownValue) {
21759 | handleError(root, thrownValue);
View compiled
scheduleUpdateOnFiber
node_modules/react-dom/cjs/react-dom.development.js:21188
21185 | // root inside of batchedUpdates should be synchronous, but layout updates
21186 | // should be deferred until the end of the batch.
21187 |
21188 | performSyncWorkOnRoot(root);
| ^ 21189 | } else {
21190 | ensureRootIsScheduled(root);
21191 | schedulePendingInteractions(root, expirationTime);
View compiled
updateContainer
node_modules/react-dom/cjs/react-dom.development.js:24373
24370 | }
24371 |
24372 | enqueueUpdate(current$1, update);
24373 | scheduleWork(current$1, expirationTime);
24374 | return expirationTime;
24375 | }
24376 | function getPublicRootInstance(container) {
View compiled
(anonymous function)
node_modules/react-dom/cjs/react-dom.development.js:24758
24755 |
24756 |
24757 | unbatchedUpdates(function () {
24758 | updateContainer(children, fiberRoot, parentComponent, callback);
| ^ 24759 | });
24760 | } else {
24761 | fiberRoot = root._internalRoot;
View compiled
unbatchedUpdates
node_modules/react-dom/cjs/react-dom.development.js:21903
21900 | executionContext |= LegacyUnbatchedContext;
21901 |
21902 | try {
21903 | return fn(a);
| ^ 21904 | } finally {
21905 | executionContext = prevExecutionContext;
21906 |
View compiled
legacyRenderSubtreeIntoContainer
node_modules/react-dom/cjs/react-dom.development.js:24757
24754 | } // Initial mount should not be batched.
24755 |
24756 |
24757 | unbatchedUpdates(function () {
| ^ 24758 | updateContainer(children, fiberRoot, parentComponent, callback);
24759 | });
24760 | } else {
View compiled
render
node_modules/react-dom/cjs/react-dom.development.js:24840
24837 | }
24838 | }
24839 |
24840 | return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
24841 | }
24842 | function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
24843 | if (!isValidContainer(containerNode)) {
View compiled
Module../src/index.js
src/index.js:18
15 |
16 | //require('es6-shim');
17 |
18 | ReactDOM.render(, document.getElementById('root'));
19 | //ReactDOM.render(, document.getElementById('root'));
20 |
21 | // If you want your app to work offline and load faster, you can change
View compiled
webpack_require
/home/ipkg01/bin/iparking/frontend/iparking-pwa/webpack/bootstrap:789
786 | };
787 |
788 | // Execute the module function
789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 790 |
791 | // Flag the module as loaded
792 | module.l = true;
View compiled
fn
/home/ipkg01/bin/iparking/frontend/iparking-pwa/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
150 | return webpack_require(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
1
http://localhost:3000/static/js/main.chunk.js:73053:18
webpack_require
/home/ipkg01/bin/iparking/frontend/iparking-pwa/webpack/bootstrap:789
786 | };
787 |
788 | // Execute the module function
789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 790 |
791 | // Flag the module as loaded
792 | module.l = true;
View compiled
checkDeferredModules
/home/ipkg01/bin/iparking/frontend/iparking-pwa/webpack/bootstrap:45
42 | }
43 | if(fulfilled) {
44 | deferredModules.splice(i--, 1);
45 | result = webpack_require(webpack_require.s = deferredModule[0]);
| ^ 46 | }
47 | }
48 |
View compiled
Array.webpackJsonpCallback [as push]
/home/ipkg01/bin/iparking/frontend/iparking-pwa/webpack/bootstrap:32
29 | deferredModules.push.apply(deferredModules, executeModules || []);
30 |
31 | // run deferred modules when all chunks ready
32 | return checkDeferredModules();
| ^ 33 | };
34 | function checkDeferredModules() {
35 | var result;
View compiled
(anonymous function)
http://localhost:3000/static/js/main.chunk.js:1:77

`

@alfoadd
Copy link

alfoadd commented Mar 26, 2021

Same exact problem

@zxpectre
Copy link
Author

The painfull solution that worked for me: The Solution

Why is firebaseui not allowing easy dynamic localization yet?, its year 5021 and still waiting.

@abnersouza
Copy link

Same issue here

@greg-schrammel
Copy link
Owner

It should be fixed now, please update to @1.1.1 (d6460d1)

@abnersouza
Copy link

Still having issues here, now with the new version it does not even open the window with the login buttons.

Screen Shot 2021-04-17 at 11 25 52

Those are the errors, same code with the version 1.0.8 no issue, only notice sometimes the buttons does not appear.

Any idea?

@greg-schrammel
Copy link
Owner

notice that now we have a version prop, that is required to specify which FirebaseUI version to use
you can see the latest release here

<FirebaseUIAuth version="4.8.0" ... />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants