Fix(deployment-id): prevent exception on old webkit#94604
Conversation
Failing test suitesCommit: 39e7ae9 | About building and testing Next.js
Expand output● app dir - metadata static routes cache › should generate different content after replace the static metadata file
Expand output● Telemetry CLI › production mode › cli session: babel tooling config ● Telemetry CLI › production mode › cli session: custom babel config (plugin) ● Telemetry CLI › production mode › cli session: package.json custom babel config (plugin) ● Telemetry CLI › production mode › cli session: custom babel config (preset) ● Telemetry CLI › production mode › cli session: next config with webpack ● Telemetry CLI › production mode › detect static 404 correctly for ● Telemetry CLI › production mode › detect page counts correctly for |
Stats cancelledCommit: 39e7ae9 |
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 propertyWhy?
We narrow down the problem to this line
delete document.documentElement.dataset.dplIdin
packages/next/src/shared/lib/deployment-id.tsIt seems to be related of how webkit implemented dataset, as discussed in this thread
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