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

Issue With VueFire 3.2.0 and Firebase 11.0.1 #1581

Open
lsecyber opened this issue Oct 23, 2024 · 5 comments · May be fixed by #1583
Open

Issue With VueFire 3.2.0 and Firebase 11.0.1 #1581

lsecyber opened this issue Oct 23, 2024 · 5 comments · May be fixed by #1583

Comments

@lsecyber
Copy link

lsecyber commented Oct 23, 2024

Steps to reproduce the bug

  1. Run npm i firebase
  2. Run npm i vuefire
  3. Check the output

Expected behavior

It installs correctly with no errors.

Actual behavior

This output is given:

npm i vuefire
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/firebase
npm error   firebase@"^11.0.1" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional firebase@"^9.0.0 || ^10.0.0" from [email protected]
npm error node_modules/vuefire
npm error   vuefire@"*" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/firebase
npm error   peerOptional firebase@"^9.0.0 || ^10.0.0" from [email protected]
npm error   node_modules/vuefire
npm error     vuefire@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/_{username_redacted}_/.npm/_logs/2024-10-23T20_12_00_862Z-eresolve-report.txt

npm error A complete log of this run can be found in: /Users/luke.ertzberger/.npm/_logs/2024-10-23T20_12_00_862Z-debug-0.log

Additional information

It appears vuefire needs to be updated to support Firebase 11.0.1 and not only Firebase 9 or 10. Or the section in the docs stating "WARNING VueFire requires Firebase JS SDK >= 9 but is compatible with Vue 2 and Vue 3." should be updated to state that it requires the Firebase JS SDK 9 or 10 but doesn't support 11. If you run "npm i firebase vuefire" together it does install correctly, but that forces it to use firebase 10.14.1.

@sceee
Copy link

sceee commented Oct 25, 2024

Adding to the above, I think the reason why the Firebase JS SDK v11 is a major release is due to the fact that it has breaking changes regarding the support for NodeJS:
Checking its changelog:

  • "The SDK no longer supports versions of Node.js below version 18"
  • "Removed ES5 bundles. The minimum required ES version is now ES2017."
  • "Removed usage of undici and node-fetch dependencies in our Node.js bundles, replacing them with the native Node.js fetch implementation."

So according to the changelog it reads that there are no breaking changes that would break vuefire so I don't see a reason why the peerDependencies could not be extended to also support v11.

@pkorac
Copy link

pkorac commented Oct 30, 2024

Second all of the above.

npm install firebase
npx nuxi@latest module add vuefire

Currently fails as the new version of firebase isn't supported.

@nycynik
Copy link

nycynik commented Nov 1, 2024

I decided to try to force it to work, installing the dependencies with --force.

I tried:

npm i vuefire --force

shows some warnings, but works. Then saw nuxt-vuefire@latest was a similar issue, so

npm install -D nuxt-vuefire@latest --force

Next I set up the configuration in the nuxt.config.ts file. I then see this config error, so - it's working

[nuxt-vuefire module 4:11:34 PM]  WARN  You activated both SSR and auth but you are not providing a service account for the admin SDK. See https://vuefire.vuejs.org/nuxt/getting-started.html#configuring-the-admin-sdk.

I also have a 500 error to go along with that, but I suspect this is due to the error above.

The default Firebase app does not exist. Make sure you call initializeApp() before using any of the Firebase services.

I added the service acccount as warned about, and it works!

@MyNetCal
Copy link

MyNetCal commented Nov 2, 2024

Same here. I had to downgrade firebase to v.10.14.1. AWS didn't let me use vuefire 3.2 with Firebase v.11

@kn0wn
Copy link

kn0wn commented Nov 5, 2024

In the meantime to suppress the warning using pnpm you can do;

  "pnpm": {
    "packageExtensions": {
      "[email protected]": {
        "peerDependencies": {
          "firebase": "^9.0.0 || ^10.0.0 || ^11.0.0"
        }
      }
    },
    "peerDependencyRules": {
      "allowedVersions": {
        "firebase": "^9.0.0 || ^10.0.0 || ^11.0.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

Successfully merging a pull request may close this issue.

6 participants