Blitz: Object doesn't support property or method 'fromEntries' in Microsoft Edge 44.19041.423.0

Created on 2 Sep 2020  路  8Comments  路  Source: blitz-js/blitz

What is the problem?

Missing polyfill for fromEntries in Edge

Steps to Reproduce

When creating a new project (blitz v0.18.0) with auth, navigating to /signup in Microsoft Edge gives the following error :

{description: "Object doesn't support property or method 'fromEntries'", message: "Object doesn't support property or method 'fromEntries'", number: -2146827850, stack: "TypeError: Object doesn't support property or method 'fromEntries' at ve (https://wwwtest.dinadvent.no/_next/static/chunks/cff9fd05d2ae0244327d25505dd7f15d06b1bfc1.c4b46960f5c0933ed6f1.js:1:80638) at me (https://wwwtest.dinadvent.no/_next/static/chunks/cff9fd05d2ae0244327d25505dd7f15d06b1bfc1.c4b46960f5c0933ed6f1.js:1:81007) at Fe (https://wwwtest.dinadvent.no/_next/static/chunks/cff9fd05d2ae0244327d25505dd7f15d06b1bfc1.c4b46960f5c0933ed6f1.js:1:87325) at h (https://wwwtest.dinadvent.no/_next/static/chunks/pages/signup-e1fb06b55868d498253e.js:1:784) at da (https://wwwtest.dinadvent.no/_next/static/chunks/framework.10c9039bc04d60b32ead.js:1:75976) at Lo (https://wwwtest.dinadvent.no/_next/static/chunks/framework.10c9039bc04d60b32ead.js:1:126429) at zu (https://wwwtest.dinadvent.no/_next/static/chunks/framework.10c9039bc04d60b32ead.js:1:118338) at Pu (https://wwwtest.dinadvent.no/_next/static/chunks/framework.10c9039bc04d60b32ead.js:1:118272) at Cu (https://wwwtest.dinadvent.no/_next/static/chunks/framework.10c9039bc04d60b32ead.js:1:118140) at gu (https://wwwtest.dinadvent.no/_next/static/chunks/framework.10c9039bc04d60b32ead.js:1:113345)"}

Versions

Blitz v0.18.0 and 0.21.0

Other

In dev, there are loads of errors in the console:
image

kinbug statudone

Most helpful comment

All 8 comments

fromEntries is used here.

I don't know if there's an easy build config we can change for this or if we should use something else instead of fromEntries

Does it really need to be Object.fromEntries and not Object.entries / Object.keys? From the interface it seems like a straight object to me

@SigurdMW I think .fromEntries is converting the array from .entries back to an object. We could definitely refactor that code to not use .fromEntries and .entries. I simple for loop would work.

Yeah but should it be needed though? Do we handle polyfills in Blitz, or is this handled by next js?

We currently don't add any polyfills to Blitz, so it would be nice to keep it that way (and rely on whatever Next does)

Thanks @belgattitude! Then we'll let Next.js fix that.

Fixed a few versions ago

Was this page helpful?
0 / 5 - 0 ratings

Related issues

flybayer picture flybayer  路  4Comments

MrLeebo picture MrLeebo  路  5Comments

timsuchanek picture timsuchanek  路  5Comments

SharadKumar picture SharadKumar  路  3Comments

markhaehnel picture markhaehnel  路  3Comments