question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: undefined is not a function

See original GitHub issue

I am using stenciljs (Ionic pwa) and I am trying to embed the firebaseui in the applications. There error I get is this: TypeError: undefined is not a function at new Sn (app-home.entry.js?s-hmr=367787020388:formatted:4184) at AppHome.componentDidLoad (app-home.entry.js?s-hmr=367787020388:formatted:4225) at safeCall (chunk-3853a083.js:1361) at postUpdateComponent (chunk-3853a083.js:1291) at updateComponent (chunk-3853a083.js:1273) at Array.update (chunk-3853a083.js:1205) at consumeTimeout (chunk-3853a083.js:120) at flush (chunk-3853a083.js:143)

And this is my code:

import { Component, h } from ‘@stencil/core’; import { firebase } from ‘@firebase/app’; import ‘@firebase/auth’; import * as firebaseui from ‘firebaseui’; import { firebaseConfig } from ‘…/…/helpers/config’;

@Component({ tag: ‘app-home’, styleUrl: ‘app-home.css’ }) export class AppHome {

componentDidLoad(){ firebase.initializeApp(firebaseConfig); var ui = new firebaseui.auth.AuthUI(firebase.auth()); console.log(ui); ui.start(‘#firebaseui-auth-container’, { signInOptions: [ { provider: firebase.auth.EmailAuthProvider.PROVIDER_ID, requireDisplayName: false } ] }); } render() { return [

>       <ion-header>
>       </ion-header>,
>       <ion-content class="ion-padding">
>         <div id="firebaseui-auth-container"></div>
>       </ion-content>
];

} }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
underyxcommented, Feb 18, 2020

I ended up with installing https://github.com/rollup/plugins/tree/master/packages/replace and using this stupid solution in my rollup plugins config:

		replace({
			"import * as firebase from 'firebase/app';": "import firebase from 'firebase/app';"
		}),
1reaction
acoreyjcommented, Feb 4, 2020

I’m having this same issue with Rollup. I think the import in firebaseui is incorrect

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: 'undefined' is not a function
Uncaught TypeError: 'undefined' is not a function. This is a common JavaScript error that happens when you try to call a function before...
Read more >
"Uncaught TypeError: undefined is not a function" - Beginner ...
That expression can be complex. So when you see undefined is not a function it means that expression did not return a function...
Read more >
TypeError: 'undefined' is not a function - Codecademy
Card Constructor function Card(suit,number) { var Suit = suit; var Number = number; var getSuit = function(){ ... TypeError: 'undefined' is not a...
Read more >
Why Do We Get 'undefined is not a function' in JavaScript?
The error speaks for itself. You want to execute a function. However, what you are trying to execute is evaluated to as undefined...
Read more >
Non-UserCodeError: TypeError: undefined is not a function
This is a common JavaScript error that happens when you try to call a function before it is defined. You get “'undefined' is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found