solid-meta icon indicating copy to clipboard operation
solid-meta copied to clipboard

Object.hasOwn is not a function

Open ChenBonBon opened this issue 1 year ago • 1 comments

My project was written in solid-start with solid-meta

In my Macbook everything is ok, but when I open it on iPad, it will trigger this error in dev mode.

iPad os version is 14.7.1.

when I remove the solid-meta, everything is ok.

f7e195ed6b26495158f9df5a475ef623_720

ChenBonBon avatar May 20 '24 08:05 ChenBonBon

The Solid Meta has this line that use Object.hasOwn https://github.com/solidjs/solid-meta/blob/8e174f9d00f7e6db480ab91f3e58096ab2503ed6/src/index.tsx#L50

According to https://caniuse.com/mdn-javascript_builtins_object_hasown, the function is not supported in Safari before version 15.4

So, to fix the issue temporarily, we can use a polyfill https://github.com/es-shims/Object.hasOwn

buymed-anhvu avatar Jun 06 '24 07:06 buymed-anhvu