remarkjs / react-markdown

Markdown component for React
https://remarkjs.github.io/react-markdown/
MIT License
12.48k stars 849 forks source link

Bug on old safari(14.1.1) macos 11.4 #800

Closed VuHoi closed 7 months ago

VuHoi commented 7 months ago

Initial checklist

Affected packages and versions

9.0.0

Link to runnable example

No response

Steps to reproduce

Screen Shot 2023-11-16 at 10 17 42 When i run on old version safari. some function JS is not support. Please help me to fix it.

Expected behavior

Support old version safari

Actual behavior

Get error when run on old version safari

Runtime

Node v17

Package manager

yarn 1

OS

macOS

Build and bundle tools

Next.js

ChristianMurphy commented 7 months ago

Welcome @VuHoi! 👋 Sorry you ran into a spot of trouble.

This is not a bug in react-markdown, this library targets ES2022. If you need to support browsers which do not fully implement ES2022, like Safari 14. You need to configure your build tool. In Next.js this is through the browserslist option https://nextjs.org/docs/architecture/supported-browsers, make sure your browsers list includes the browsers you want to support.

Next.js should automatically polyfill it with the correct settings. If it does not, follow their guide on manually polyfilling from the same page, and apply the Core.js polyfill https://github.com/zloirock/core-js#ecmascript-object

github-actions[bot] commented 7 months ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.