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

3.2.38 regression error for multi-branch dynamic slots #6651

Closed
shigma opened this issue Sep 12, 2022 · 4 comments · Fixed by #6660
Closed

3.2.38 regression error for multi-branch dynamic slots #6651

shigma opened this issue Sep 12, 2022 · 4 comments · Fixed by #6660
Labels
🐞 bug Something isn't working regression

Comments

@shigma
Copy link
Contributor

shigma commented Sep 12, 2022

Vue version

3.2.38, 3.2.39 (above commit 00036bb)

Link to minimal reproduction

https://sfc.vuejs.org/#eNqFUstOwzAQ/BXLHHppbImeqAIq4jd8CckGDPFD6004RPl31klapUXAzTszOxOPM8rnGNXQgzzKMtVoI4kE1Mcn462LAUmMAqEVk2gxOLFj6e5CvQQXV1zpPGQnpku9WLEJDwQudhUBT0KUWTafDF0YcVcHT+BJDIVtH40k7MHIWcYr+srhlz3oEvy/XM6fyccNLvdyuU/hqqg+UvBcxjhHrUQy8ihmJGN8xzwb+U4U01Hr3sfPN1UHp0/Maew9WQdFE9zpoO7V4UE3NtEWV5Bc8YrhKwFyopH7jblmcAAsEHwDCPhn2I32KvCG+xGaMyfjJy7g/Hj5N9gUxl03djhXmbpAwlcOuOS1eO6ZH5vxtd1FvS13+gZ/SNE7

Steps to reproduce

Build the project with SSR.

What is expected?

The build should pass.

What is actually happening?

TypeError: Cannot set properties of undefined (setting 'key')
    at slots.<computed>

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 12.46 GB / 23.84 GB
  Binaries:
    Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.15 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 105.0.5195.102
    Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.33)
    Internet Explorer: 11.0.19041.1566

Any additional comments?

00036bb#diff-38ca58cc499824842d1f7106fb614647e756cbdc1982bc04cd3c10fb379893c1R33-R36

res may be undefined. Adding a nullable check may help. If this change is acceptable I am willing to provide a PR.

            const res = slot.fn(...args)
+           if (!res) return res
            // attach branch key so each conditional branch is considered a
            // different fragment
            ;(res as any).key = slot.key
            return res
@shigma
Copy link
Contributor Author

shigma commented Sep 12, 2022

Duplicate of #6639

@edison1105
Copy link
Member

@shigma PR welcome.

@shigma
Copy link
Contributor Author

shigma commented Sep 21, 2022

@edison1105 I opened #6660. Is there any hope that we can get it in a future version?

@spacedawwwg
Copy link

Just hit this same issue upgrading from 3.2.37

chrislone pushed a commit to chrislone/core that referenced this issue Feb 4, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants