Skip to content

[custom elements api] Cannot set properties of null (setting 'parent') with { shadowRoot: false } #13199

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

Open
wolandec opened this issue Apr 14, 2025 · 0 comments · May be fixed by #13201
Open
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements

Comments

@wolandec
Copy link

Vue version

3.5.13

Link to minimal reproduction

https://play.vuejs.org/#eNqtVU1v2kAQ/StTXzAKH+nHiQJqg5CaHtooidSLL449hk2WXWt3DZGQ/3tnvXZsg0OD0hN45s3s23nP4733PU1H2wy9iTfVkWKpAY0mS+eBYJtUKgN7hckAIrlJM4NxDomSG+hRSe8Fslj+UWGaovotsMyPxs2gPaEDfr+Tx3AKlvBARFJoA0zfreVOwAyIip+EXGP/a52OZCZMmbzs1/GHzBgp7vHZJiv+vt+fzWEfCACWgF/UjrYhzxBmsxlc9qmNyZSAnj2zfTNqa1AYYtZd/LEu/sFiPK/40xtOhnAVMgGhiEkkBLNGQKWk6mw6b7a8NrBjnIPALSqKiph+im5UmxdDC0SSicgwKWBNJyC/Kua34Cx68vtuYk6IijV8aAUsokHg4oI6B2I6drYiQ9GDwU3KQ4P0BDB1CsG3yJ4xC7yjcwNvvt/XOub5dOyeim7UoTWlSUmHOpX/qN7CmkCy19id3nIohabjBjtv4BlNY0/YavSopaD3oxhB4FknMU5FqZ2VDryJs5PNhZzL3c8iZlSGgyoerTF66og/6mcbC7wbhRrVFgPvJWdCtULj0su7X3T9RnIj44wT+kTyFrXkmeXoYFeZiIl2A1ewvS7eSSZW93r5TCbT1aUsUYvMC3zg0Tu5OHH1mu7n0ZeijuSnKS4ybeRmyXFDBi5XweGyAR6KFalmqGVj8UCMCRN4o2Sqobl4ipe/kZw23TmBByk5hgTJ5z5Z+5QDY7aF7ZAlXZbRXBqovELADou0LlcuLnu5o0PO6XmwN987rHrtHihRr94OieyMD1q3YO/Qo9rPi6UlMevq7h9SGhALvQ5jubuV0kyg+AiAW1x28X2ImgV6RFb0ey42RBccSoG9ft859gDuKHRWDBxP+8H5xzY7LrYbaahfW0nWC5UVjmtPOaPhtFe+2W+RrMsWrS9yh7md1JV+Fv0G/Qj2P/QzO3mmfrbC6kcEztePikul3GWgTAAlqg9yp3iusCGel/8FmKlMQQ==

Steps to reproduce

Click on the button multiple times and see Cannot set properties of null (setting 'parent')

What is expected?

No issue with setting parent and Custom element two content renders properly when we click on the button multiple times

What is actually happening?

First time custom elements are mounted properly, then we hide them clicking on the button.

When we click on the button again to show them once again, the exception is thrown on this line of code

System Info

System:
    OS: macOS 15.3.2
    CPU: (12) arm64 Apple M3 Pro
    Memory: 92.97 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.13.1 - ~/Library/pnpm/node
    npm: 10.9.2 - ~/Library/pnpm/npm
    pnpm: 9.14.2 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 135.0.7049.85
    Safari: 18.3.1
  npmPackages:
    vue: latest => 3.5.13

Any additional comments?

The issue is related to the slots within custom elements created from Vue 3 components. Looks like something is related to custom elements lifecycle and how Vue 3 uses them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements
Projects
None yet
2 participants