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

Fix Vercel build #5830

merged 6 commits into from Jan 10, 2022

Fix Vercel build #5830

merged 6 commits into from Jan 10, 2022


Copy link

@schmidt-sebastian schmidt-sebastian commented Dec 21, 2021

This changes the manual replacement code to produce the exact output I got in 9.2:

url.fileURLToPath((typeof document === 'undefined' ? new (require('url').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.node.cjs.js', document.baseURI).href)));

Fixes #5823

Copy link

@changeset-bot changeset-bot bot commented Dec 21, 2021

🦋 Changeset detected

Latest commit: b333c0a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/firestore Patch
firebase Patch
@firebase/firestore-compat Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

// be able to use require() in esm. It only generates the nodejs version of the
// polyfill, as opposed to the default polyfill which supports both browser and
// nodejs. The browser support is unnecessary and doesn't work well with Jest.
// See
Copy link
Contributor Author

@schmidt-sebastian schmidt-sebastian Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-wrapped this comment

Copy link

@hsubox76 hsubox76 Jan 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you check the link, the ternary was originally removed because the document check was coming up true for Jest which caused it to take the second option which broke Jest somehow, so I think this will break Jest again. I am not sure why Vercel is using the Node bundle in what seems to be a non-Node environment but I'll try to look into that right away.

Copy link

@google-oss-bot google-oss-bot commented Dec 21, 2021

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (9ca74ee)Merge (3ac99e3)Diff
    browser227 kB228 kB+262 B (+0.1%)
    esm5284 kB285 kB+306 B (+0.1%)
    main426 kB427 kB+631 B (+0.1%)
    module227 kB228 kB+262 B (+0.1%)
    react-native228 kB228 kB+263 B (+0.1%)
  • @firebase/firestore-lite

    TypeBase (9ca74ee)Merge (3ac99e3)Diff
    browser72.4 kB72.6 kB+191 B (+0.3%)
    esm585.7 kB85.9 kB+221 B (+0.3%)
    main125 kB125 kB+224 B (+0.2%)
    module72.4 kB72.6 kB+191 B (+0.3%)
    react-native72.6 kB72.8 kB+181 B (+0.2%)
  • bundle

    12 size changes

    TypeBase (9ca74ee)Merge (3ac99e3)Diff
    firestore (Persistence)229 kB229 kB+233 B (+0.1%)
    firestore (Query Cursors)189 kB189 kB+233 B (+0.1%)
    firestore (Query)190 kB190 kB+233 B (+0.1%)
    firestore (Read data once)178 kB178 kB+233 B (+0.1%)
    firestore (Realtime updates)180 kB181 kB+233 B (+0.1%)
    firestore (Transaction)163 kB163 kB+153 B (+0.1%)
    firestore (Write data)162 kB162 kB+153 B (+0.1%)
    firestore-lite (Query Cursors)56.3 kB56.4 kB+135 B (+0.2%)
    firestore-lite (Query)59.4 kB59.5 kB+153 B (+0.3%)
    firestore-lite (Read data once)43.9 kB44.0 kB+135 B (+0.3%)
    firestore-lite (Transaction)61.2 kB61.4 kB+135 B (+0.2%)
    firestore-lite (Write data)46.8 kB46.9 kB+135 B (+0.3%)

  • firebase

    14 size changes

    TypeBase (9ca74ee)Merge (3ac99e3)Diff
    firebase-analytics.js107 kB107 kB+151 B (+0.1%)
    firebase-app-check.js89.8 kB89.9 kB+151 B (+0.2%)
    firebase-app.js51.3 kB51.4 kB+151 B (+0.3%)
    firebase-auth.js411 kB411 kB+123 B (+0.0%)
    firebase-compat.js753 kB753 kB+240 B (+0.0%)
    firebase-firestore-compat.js280 kB281 kB+787 B (+0.3%)
    firebase-firestore-lite.js245 kB249 kB+4.03 kB (+1.6%)
    firebase-firestore.js766 kB770 kB+3.81 kB (+0.5%)
    firebase-functions.js30.9 kB31.1 kB+151 B (+0.5%)
    firebase-messaging-sw.js102 kB102 kB+151 B (+0.1%)
    firebase-messaging.js101 kB101 kB+151 B (+0.2%)
    firebase-performance.js119 kB119 kB+151 B (+0.1%)
    firebase-remote-config.js108 kB109 kB+151 B (+0.1%)
    firebase-storage.js145 kB146 kB+772 B (+0.5%)

Test Logs


Copy link

@google-oss-bot google-oss-bot commented Dec 21, 2021

Size Analysis Report 1

This report is too large (1361656 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs


@schmidt-sebastian schmidt-sebastian merged commit 044a8d7 into master Jan 10, 2022
19 checks passed
@schmidt-sebastian schmidt-sebastian deleted the mrschmid/vercel branch Jan 10, 2022
@google-oss-bot google-oss-bot mentioned this pull request Jan 12, 2022
@firebase firebase locked and limited conversation to collaborators Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

Successfully merging this pull request may close these issues.

3 participants