You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When that block of code is executed on certain notable older browsers, the following error will be thrown:
TypeError: Cannot redefine property: name
My team has run into this issue in our support of Android 5.0 / API 21 devices, which (if not updated) defaults to Chrome for Android 35.
This is fortunately rather easy to verify through Android Studio:
Via "Tools" > "Device Manager"...
The "Nexus S" and "Pixel 2 XL" simulation targets can be configured for use of API 21, which have images set to Chrome 35
From there, remote-device inspection can then be used to inspect inside the simulated app's webview.
Then, within the Chrome inspector window, via Console, enter the following lines commands in sequence:
vartemp=function(){console.log("hello")};console.log(temp.name);// outputs "" on API 21 / Android 5.0Object.defineProperty(temp,'name',{value: 'temp',configurable: true});// will throw the error on API 21 / Android 5.0.
I cannot guarantee that API 21 is either the earliest or the last Android API to have this issue; it's simply the earliest one my team supports and is the version for which we encountered the issue.
I suppose this is a case in which keepNames should simply be off... and that's probably fair. Would be nice if there were an error clearly denoting that keepNames has failed in these cases, though - it took quite a bit of investigation to reach this conclusion.
The text was updated successfully, but these errors were encountered:
jahorton
changed the title
esbuild name minification results in errors in older browsers
esbuild identifier minification results in errors in older browsers
Nov 6, 2023
jahorton
changed the title
esbuild identifier minification results in errors in older browsers
esbuild keepNames use results in errors in older browsers
Nov 6, 2023
I think this corresponds to this configurable: true support matrix. I should be able to make esbuild generate an error if you attempt to configure it this way.
From part of
esbuild
'skeepNames
(https://esbuild.github.io/api/#keep-names) setup:When that block of code is executed on certain notable older browsers, the following error will be thrown:
My team has run into this issue in our support of Android 5.0 / API 21 devices, which (if not updated) defaults to Chrome for Android 35.
This is fortunately rather easy to verify through Android Studio:
I cannot guarantee that API 21 is either the earliest or the last Android API to have this issue; it's simply the earliest one my team supports and is the version for which we encountered the issue.
I suppose this is a case in which
keepNames
should simply be off... and that's probably fair. Would be nice if there were an error clearly denoting thatkeepNames
has failed in these cases, though - it took quite a bit of investigation to reach this conclusion.The text was updated successfully, but these errors were encountered: