Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@vitejs/plugin-legacy] Object.defineProperty(n, "name") breaks on Safari 9 #19009

Closed
7 tasks done
pecoram opened this issue Dec 19, 2024 · 1 comment
Closed
7 tasks done

Comments

@pecoram
Copy link

pecoram commented Dec 19, 2024

Describe the bug

I encountered an issue with the Vite legacy plugin when generating the index-legacy. The produced code uses Object.defineProperty to define a property with the key "name". However, on Safari 9, "name" is a protected key, causing an error during execution.

Attempting to change configurable attribute of unconfigurable property

Generated code example:

var nt = Object.defineProperty,
    at = u("az", function (a, l) {
        return nt(a, "name", { value: l, configurable: !0 });
    });

By replacing "name" with a different key, such as "property", the issue is resolved.

Reproduction

no-url

Steps to reproduce

No response

System Info

All system versions

Used Package Manager

npm

Logs

No response

Validations

Copy link

Hello @pecoram. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs reproduction will be closed if they have no activity within 3 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 24, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants