Uncaught TypeError: Cannot convert object to primitive value
See original GitHub issueI’m seeing the following error upgrading from 2.9 to 2.11.0:
Uncaught TypeError: Cannot convert object to primitive value
toString
is being called on an array containing objects of label/value pairs:
toString
appears to be initiated from an assert
statement in the set
function:
I believe set
is being initiated on a component property in a template from a helper. In this case, the group
helper simply returns the params that were passed into it:
checkboxes=(group
(hash label="Foo" value="foo")
(hash label="Bar" value="bar")
)
I created an Ember Twiddle but I was unable to reproduce the error: https://ember-twiddle.com/ae1d147bd798f9ba0c499c271c743eb3?openFiles=templates.application.hbs%2Ctemplates.components.my-component.hbs
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Cannot convert object to primitive value - Stack Overflow
most of the Javascript objects have toString() method inherited from Object.prototype . but some of them that have a null prototype , not...
Read more >Object to primitive conversion - The Modern JavaScript Tutorial
So, when the conversion looks for a toString function in obj , if it doesn't find it there then it keeps looking for...
Read more >Cannot convert object to primitive value | The Node.js Master ...
Your browser can't play this video. ... Bonus Lecture - TypeError : Cannot convert object to primitive value | The Node.js Master Class....
Read more >Uncaught TypeError: Cannot convert object to primitive value
jQuery 3.5 seems to have an issue that's breaking Bootstrap JS components (like accordion). I updated jQuery Updater plugin and it caused the...
Read more >error typeerror: cannot convert object to primitive value
What's causing this error-message in general is that the system tries to convert some object to a string but can not produce a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The rough issue is this:
The assertion is attempting to convert
content
to a string (to make the error message nice), but callingObject.create(null) + ''
throws an error…It really solved my trouble. I did put an object in
string ${val}
, this was having error.