baumblatt / capacitor-firebase-auth

Capacitor Firebase Authentication Plugin
MIT License
261 stars 129 forks source link

Stenciljs - Error with M.signIn #54

Closed lucapale closed 4 years ago

lucapale commented 4 years ago

I have tried several times to setup as explained, but I keep getting this error: [error] - {"line":17,"column":28716,"sourceURL":"capacitor://localhost/build/p-05bb7ce0.js"}

⚡️ ------ STARTUP JS ERROR ------

⚡️ TypeError: undefined is not an object (evaluating 'M.signIn') ⚡️ URL: capacitor://localhost/build/p-4c7259e1.js ⚡️ p-4c7259e1.js:1840:1810

Do you have any idea where could be the problem? I am trying to login using a Stenciljs app. Thanks!

baumblatt commented 4 years ago

Hi @lucapale ,

Do you initialize your FirebaseApp? Are you using the latest version of the plugin?

Please, take a look at the issue #38 , there is a great discussion about using the plugin with Stenciljs.

Best regards, Bernardo Baumblatt.

lucapale commented 4 years ago

The Firebase App is initialized, as it works correctly in the PWA version. Now I am trying to run it on iOS. It seems that inside facades.js the: const plugin = Plugins.CapacitorFirebaseAuth; returns undefined. I have defined the plugin inside capacitor.config.json, but maybe there is something that I am missing. Any idea? Thanks fr the nice plugin! Luca

lucapale commented 4 years ago

Also I see this file in the plugin:

CapacitorFirebaseAuth.podspec does it require any specific action from my side?

lucapale commented 4 years ago

@socalrunner, since you have direct experience in Stencil, do you have any suggestion on this issue?

baumblatt commented 4 years ago

Hi @lucapale ,

Please, can you share your Podfile.lock?

About specific actions, maybe, you need run pod install, but this is strange because npx cap sync already do this for you.

Any chance you share your project? I'm not a Stencil guy, but I can try to figure out what's wrong in your xCode project.

Best regards, Bernardo Baumblatt.

lucapale commented 4 years ago

Sure. I can share also the project, how do you suggest to send you the code? Here's my Podfile: `PODS:

DEPENDENCIES:

SPEC REPOS: trunk:

EXTERNAL SOURCES: Capacitor: :path: "../../node_modules/@capacitor/ios" CapacitorCordova: :path: "../../node_modules/@capacitor/ios" CordovaPluginsStatic: :path: "../capacitor-cordova-ios-plugins"

SPEC CHECKSUMS: AppAuth: 73574f3013a1e65b9601a3ddc8b3158cce68c09d Capacitor: e548fe61e71fa160367a36387f54483647ca20f6 CapacitorCordova: 17c1ed13e5303aa5153fb405adb4196cc56b40d5 CordovaPluginsStatic: 130c30f832724eab94d17a9509a557c63c0fc2be FBSDKCoreKit: a72c8d2c42aa4c4d5eaa5f160be9580750f70d2e FBSDKLoginKit: 89f3c2f8be892ec8a5359619a8ff657578d47604 Firebase: 8432d732974498afd5987e9001a05f90f1a3d625 FirebaseAnalytics: 470ddab7253b21ad5a40bebd4a9903d7ae19386a FirebaseAnalyticsInterop: 3f86269c38ae41f47afeb43ebf32a001f58fcdae FirebaseAuth: 7fa2cc010b93770831a4e7a60651b52c3b8d111a FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc FirebaseCore: 68f8a7f50cdae542715d4e86afa37c4067217dcb FirebaseDynamicLinks: 2ba929800a256ecbf6ee28b2af9d73edf46e8914 FirebaseInstanceID: ebd2ea79ee38db0cb5f5167b17a0d387e1cc7b6e FirebaseMessaging: 6bb0bdaf64c55fef7a219b7bb1e94e94a0855ced GoogleAppMeasurement: a35a645835bae31b6bdc0576396bc23908f12a22 GoogleSignIn: 7137d297ddc022a7e0aa4619c86d72c909fa7213 GoogleUtilities: f8de7ddf8c706f58e9b405d53e38bbdaa2731e5a GTMAppAuth: 4deac854479704f348309e7b66189e604cf5e01e GTMSessionFetcher: cea130bbfe5a7edc8d06d3f0d17288c32ffe9925 nanopb: 18003b5e52dab79db540fe93fe9579f399bd1ccd Protobuf: dd1aaea7140debfe4dd0683fb8ef208e527ae153

PODFILE CHECKSUM: c96e2461abd36556300b0649f4f463a4db1e9a99

COCOAPODS: 1.8.4 `

Thanks you! Luca

baumblatt commented 4 years ago

Hi Luca,

The best way to share your project is a private repository at github.com, but it will not be necessary anymore.

As we can see, the plugin is missing in your Podfile.lock, so it’s time to take a look in your Podfile, that should be looks like this:

def capacitor_pods
  # Automatic Capacitor Pod dependencies, do not delete
  pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
  pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
  pod 'CapacitorFirebaseAuth', :path => '../../../capacitor-firebase-auth'
  # Do not delete
end

As I told you, the Capacitor framework do this automatically during the npx cap sync, are you sure that you run it after install the plugin in your project?

If you like this plugin, please don't forget to put a star on the project to help others to find it.

Best regards, Bernardo Baumblatt

lucapale commented 4 years ago

Great! Thanks for the support. I honestly never run the npx cap sync command, as I was only updating the Pods with pod update, so I was missing this step. I would suggest to specify this in the readme, so that it's a clear step for the installation. Thank you again for your kind support and enjoy the beer!

baumblatt commented 4 years ago

Hi Luca,

Great news, happy to know that everything is working now.

Your suggestion to installation guide is already there.

Really thank you for the beer, cheers!

Best regards, Bernardo Baumblatt.