next.js
b6d83ada - Fix(deployment-id): prevent exception on old webkit (#94604)

Commit
12 days ago
Fix(deployment-id): prevent exception on old webkit (#94604) ### What? Start a next application after 16.2.0 in a safari 9 which is used in playstation 4. The application will error with this message ```TypeError: Unable to delete property``` ### Why? We narrow down the problem to this line ```delete document.documentElement.dataset.dplId ``` in ```packages/next/src/shared/lib/deployment-id.ts ``` It seems to be related of how webkit implemented dataset, as discussed in this [thread](https://stackoverflow.com/questions/28973603/unable-to-delete-property-on-safari-when-trying-to-delete-dataset-attribute-in) ### How? replace this line ``` delete document.documentElement.dataset.dplId; ``` with ``` document.documentElement.removeAttribute('data-dpl-id');``` if data cannot be deleted , we can remove the attribute. It should achieve the same with a different syntax Fixes #94601
Author
Parents
Loading