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

"Uncaught SyntaxError: Function statements require a function name" error with firebase/firestore #11626

Closed
7 tasks done
jacekkarczmarczyk opened this issue Jan 7, 2023 · 2 comments
Labels
bug: upstream Bug in a dependency of Vite p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@jacekkarczmarczyk
Copy link

jacekkarczmarczyk commented Jan 7, 2023

Describe the bug

// main.js
import * as firestore from 'firebase/firestore';

console.log(firestore);

Using stuff from firebase/firestore throws a Uncaught SyntaxError: Function statements require a function name error in the browser

That is not happening with Vue CLI app (so that may mean that it's not a firebase issue), that also didn't happen with vite a while ago (approx. few months, not sure what version I was using at that time, tried to narrow dependencies versions but without success)

Reproduction

https://github.com/jacekkarczmarczyk/vite-firebase-issue

Steps to reproduce

Clone repo, run pnpm dev, open browser console

Stackblitz version: https://stackblitz.com/github/jacekkarczmarczyk/vite-firebase-issue?file=src%2Fmain.js

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 2.14 GB / 15.87 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.1.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 108.0.5359.125
    Edge: Spartan (44.19041.1266.0), Chromium (108.0.1462.76)
    Internet Explorer: 11.0.19041.1566

Used Package Manager

pnpm

Logs

No response

Validations

@sapphi-red
Copy link
Member

This seems to be a bug in esbuild: evanw/esbuild#2805

@sapphi-red sapphi-red added the p3-minor-bug An edge case that only affects very specific usage (priority) label Jan 8, 2023
@sapphi-red
Copy link
Member

Closing as this is fixed by esbuild v0.16.16.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: upstream Bug in a dependency of Vite p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

2 participants