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.

Cannot inspect a model in detail

See original GitHub issue

Hello,

If I want to inspect a model (by clicking on an instance of a EmberData model) I have the following error:

Ember Inspector has errored.
This is likely a bug in the inspector itself.
You can report bugs at https://github.com/emberjs/ember-inspector.
Error message: Cannot read property 'toString' of undefined
Stack trace: TypeError: Cannot read property 'toString' of undefined
    at CoreObject.PrototypeMixin._emberMetalMixin.Mixin.create._Mixin$create.toString (http://localhost:4200/assets/vendor.js:53451:37)
    at Object.addListener (http://localhost:4200/assets/vendor.js:34685:88)
    at addObserver (http://localhost:4200/assets/vendor.js:38047:23)
    at Class.bindPropertyToDebugger (<anonymous>:3244:7)
    at <anonymous>:3259:20
    at Array.forEach (native)
    at <anonymous>:3253:26
    at Array.forEach (native)
    at Class.bindProperties (<anonymous>:3252:20)
    at Class.mixinsForObject (<anonymous>:3203:12)

I’m using Ember 2.8 Ember-data 2.8.0 Ember Inspector 2.0.3

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
mpiriocommented, Nov 7, 2016

Hello,

This error appear when we use these models:

// model/base.js
import Ember from 'ember';
import Model from 'ember-data/model';

export default Model.extend({
    modelName: Ember.computed.alias('constructor.modelName')
});

// model/model1.js
import Ember from 'ember';
import Base from './base';

export default Base.extend({
    ...
});

If we inspect model1 with Ember Inspector, we have the same error. But if we comment modelName CP in Base model, no error…

We use this CP to get the modelName of a polymorphic relationship (see How to get the modelname of a polymorphic relationship belongsto on discuss.emberjs.com) so we can use {{model.ourRelation.modelName}} instead of {{model.ourRelation.content.constructor.modelName}} in templates.

1reaction
pbishop16commented, Nov 7, 2018

@rwwagner90 I greatly apologize, but no updates. I am finally hitting a solid steady state on my new job. Will address this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't inspect code from an object in Python - Stack Overflow
So it seems to make sense that inspecting the class returns the appropriate source file. What I don't understand is why does inspecting...
Read more >
How to Inspect Element: Simple Methods for Editing a Web Page
Read this article to learn how to inspect element in browsers and make ... Elements/Document Object Model (DOM) panel – contains the page's ......
Read more >
inspect — Inspect live objects — Python 3.11.1 documentation
The inspect module provides several useful functions to help get information about live objects such as modules, classes, methods, functions, tracebacks, frame ...
Read more >
How to Inspect Dynamic HTML Elements (that keep ...
So to work around this in the Developer Tools inspector, right click on the element that is driving the elements to appear/disappear (kendo- ......
Read more >
How to Use Your Browser's Inspect Element Tool to Edit ...
Learn how to use your browser's inspect element tool to check a webpage's HTML code. Also, edit and troubleshoot webpages locally with it....
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