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

vite 4.1 broke package resolution for firebase-admin #13197

Closed
7 tasks done
Fuzzyma opened this issue May 14, 2023 · 2 comments
Closed
7 tasks done

vite 4.1 broke package resolution for firebase-admin #13197

Fuzzyma opened this issue May 14, 2023 · 2 comments

Comments

@Fuzzyma
Copy link

Fuzzyma commented May 14, 2023

Describe the bug

Since vite 4.1, an error pops up in dev-mode because the resolution of some package in firebase-admin failed.
I am aware that this package is not meant to be used in the frontend but its a bug nonetheless.

The last working version is 4.0.4

Reproduction

https://stackblitz.com/edit/vitejs-vite-r4r6p2?file=main.js

Steps to reproduce

npm run dev

Then look into the console to see the error

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 PRO 6850HS with Radeon Graphics
    Memory: 12.02 GB / 15.28 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 19.8.1 - ~/.nvm/versions/node/v19.8.1/bin/node
    Yarn: 3.3.0 - /usr/bin/yarn
    npm: 8.19.4 - ~/repos/packmatic/node_modules/.bin/npm

But it also happens in the reproduction so i guess that doesnt matter

Used Package Manager

npm

Logs

No response

Validations

@stackblitz
Copy link

stackblitz bot commented May 14, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sapphi-red
Copy link
Member

sapphi-red commented May 14, 2023

This was incorrectly resolved in pre-4.1 (#11595).
@firebase/database-compat@0.2.5 does not have a non-node export condition for standalone export.
https://cdn.jsdelivr.net/npm/@firebase/database-compat@0.2.5/package.json
So Vite shouldn't have resolved the import.

Closing as this is working as intended.

FYI it seems the exports field is fixed from @firebase/database-compat@0.3.4.

@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants