Compile error in firebase web3 auth


↑I built the site according to the video up
I got the following error after
npm run start
console error:

Uncaught Error: Component auth has not been registered yet
    at Provider.initialize (provider.ts:239:1)
    at initializeAuth (initialize.ts:66:1)
    at getAuth (index.ts:80:1)
    at getMoralisAuth (getMoralisAuth.ts:36:1)
    at ./src/App.js (App.js:19:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at ./src/index.js (App.js:62:1)
    at options.factory (react refresh:6:1)

compile error:

WARNING in ./node_modules/@metamask/detect-provider/dist/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@metamask/detect-provider/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@metamask/detect-provider/src/index.ts'

WARNING in ./node_modules/@moralisweb3/client-firebase-auth-utils/lib/getMoralisAuth.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-auth-utils/src/getMoralisAuth.ts' file: Error: ENOENT: no such file or directory, open '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-auth-utils/src/getMoralisAuth.ts'

WARNING in ./node_modules/@moralisweb3/client-firebase-auth-utils/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-auth-utils/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-auth-utils/src/index.ts'

WARNING in ./node_modules/@moralisweb3/client-firebase-auth-utils/lib/issueToken.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-auth-utils/src/issueToken.ts' file: Error: ENOENT: no such file or directory, open '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-auth-utils/src/issueToken.ts'

WARNING in ./node_modules/@moralisweb3/client-firebase-auth-utils/lib/requestMessage.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-auth-utils/src/requestMessage.ts' file: Error: ENOENT: no such file or directory, open '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-auth-utils/src/requestMessage.ts'

WARNING in ./node_modules/@moralisweb3/client-firebase-evm-auth/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-evm-auth/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-evm-auth/src/index.ts'

WARNING in ./node_modules/@moralisweb3/client-firebase-evm-auth/lib/signInWithMoralis.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-evm-auth/src/signInWithMoralis.ts' file: Error: ENOENT: no such file or directory, open '/Users/allegorywrite/wagmi/moralis-test/frontend/node_modules/@moralisweb3/client-firebase-evm-auth/src/signInWithMoralis.ts'

Do you know the cause of the error?
Thank you in advance.

dependency:

{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@moralisweb3/client-firebase-auth-utils": "^2.6.4",
    "@moralisweb3/client-firebase-evm-auth": "^2.6.4",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "firebase": "^9.11.0",
    "moralis": "^2.6.4",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

In the src/App.js file replace the getAuth import with the below line. Seems like this is causing that error.

import { getAuth } from "firebase/auth";
1 Like

I also have this error and unfortunatelly this solution didn’t worked.

Hi @EvandroAK
Can you please share more details of your code and error logs related to the issue?

Hi, John. Im not trying to make this work anymore, can you please help me in this thread: Yarn error regarding node version in firebase-nodejs tutorial
Thank you!