solidjs / solid-meta

Write meta tags to the document head
125 stars 16 forks source link

Object.hasOwn is not a function #48

Open ChenBonBon opened 1 month ago

ChenBonBon commented 1 month ago

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

buymed-anhvu commented 1 month ago

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