question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot convert object to primitive value

See original GitHub issue

I’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:

screen shot 2017-02-09 at 3 46 15 pm

toString appears to be initiated from an assert statement in the set function:

screen shot 2017-02-09 at 3 46 39 pm

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:closed
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
rwjbluecommented, Feb 10, 2017

The rough issue is this:

screenshot

The assertion is attempting to convert content to a string (to make the error message nice), but calling Object.create(null) + '' throws an error…

0reactions
mrgenesiscommented, Sep 27, 2018

The rough issue is this:

screenshot

The assertion is attempting to convert content to a string (to make the error message nice), but calling Object.create(null) + '' throws an error…

It really solved my trouble. I did put an object in string ${val}, this was having error.

image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found