-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
(runtime-core): Runtime error when mistakenly converting symbols to a string during props validation #8487
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
Comments
I was about to create an issue for this, but last minute i found this one. From my testing the bug was introduced in would love to see this fixed :) |
@dodgex I believe that this bug has been around for a while since the affected part of the code hasn't been changed in ~4 years. It seems you can reproduce it on almost every 3.x version, not only 3.3.x. |
@mattersj my project is on 3.2.45 and i have multiple components using symbols (InjectionKey to be accurate) as props. and with 3.3.4 i got this issue. I tested I even had a project prepared to reproduce my issue working with |
@dodgex I think you're talking about slightly different issue here: Since 3.3 (probably, specifically That way, you just encountered another bug related to a type resolving, so feel free to open a new issue if one is not created yet. P.S. as a temporary solution you can replace |
I tried to recreate the repro for a new issue as you suggested but now it seems to work in a blank vue project. No Idea what i did diffrent 2 days ago when testing it. But what I found is that it somehow relates my For now i might have to abort and delay the upgrade to vue3.3; but in case you can see an issue and have a suggestion what could be causing this, i leave my tsconfig below.
Thanks and sorry for hijacking this issue. |
Vue version
3.3.4
Link to minimal reproduction
https://play.vuejs.org/#eNqFjsEKgzAQRH9lyaUWiqFXiULxBwSvuViNNWCSJVkLRfz3Rm2hhUJvO7uzb2ZmF8T0PimWMRFar5EgKJqwkFYbdJ6gdAah987AIeWrWO0HaaVtnQ3R/jBXN0IO9TYkR2kF31EREgUpg2NDKioAMZyLqvHKkuBx3FZbQkYqUC7ZjpMMeDwK/vHMTuwd/6Ntp3ptVeUdhmSGFZZBTV7bGyz/K5WDHrtXo+/Q5QneXWVa
Steps to reproduce
Steps to reproduce the bug from scratch (repro already has this covered):
What is expected?
A classic warning about type mismatch, e.g.
Invalid prop: type check failed for prop "propName". Expected String, got Symbol
What is actually happening?
A runtime error because
getInvalidTypeMessage
function is trying to convert the symbol to a string/number.System Info
Any additional comments?
The fix could be pretty straightforward: check if we have a
symbol
instyleValue
function and do not convert a value to anything else since it won't be useful anyway.I'm going to submit a PR that fixes this issue.
The text was updated successfully, but these errors were encountered: