ember-inspector icon indicating copy to clipboard operation
ember-inspector copied to clipboard

Ember Inspector causing "Assertion Failed: Illegal set of identifier"

Open simonc opened this issue 3 years ago • 16 comments

Describe the bug

After experiencing random cases of the Assertion Failed: Illegal set of identifier error I looked for any information and ended up on this StackOverflow question and more specifically this comment by HappyDude stating that this error can sometimes be caused by Ember Inspector.

I disabled Ember Inspector and it fixed the issue.

One element I can add is that the model causing the issue appeared twice in the inspector Data tab.

To Reproduce

I'm very sad and sorry not to be able to give any useful reproduction steps as it happens randomly.

Environment

Ember: 3.28.8 Ember Data: 3.28.6 Ember Inspector: 4.5.11 Firefox: 95.0.2 (64-bit) on a Mac


Taking the opportunity to thank all the team working on this otherwise wonderful tool that Ember Inspector is ❤️

simonc avatar Jan 12 '22 02:01 simonc

I just ran into this bug, and it happened when I added a hasMany to the model I was working with.

numero-trey avatar Jan 21 '22 22:01 numero-trey

@numero-trey would you be able to provide us with a small reproduction please?

RobbieTheWagner avatar Jan 25 '22 16:01 RobbieTheWagner

same for me, preconditions:

ember-data: 3.28.7 browser: chrome os: windows devtools open: true ember inspector open: true ember-data request: findRecord called in model hook

If I close chrome dev-tools, all works fine If I open chrom dev-tools, all works fine If I open chrom dev-tools on ember inspector page - I see issue after page reload

lifeart avatar Jan 25 '22 21:01 lifeart

Same for me. I was able to create a reproduction.

luxzeitlos avatar Jan 25 '22 21:01 luxzeitlos

error firing in this line: image

next jump into:

image

next:

image

next:

image

also, after error, model is unloaded (in catch case) =>

image

lifeart avatar Jan 25 '22 22:01 lifeart

tldr: looks like observeModelType called 2 times, and it's leads to error

image

lifeart avatar Jan 25 '22 22:01 lifeart

looks like we have idea how to fix it: https://discord.com/channels/480462759797063690/486549196837486592/935672357840900118

--

upd: not really

-- image

lifeart avatar Jan 25 '22 23:01 lifeart

image if I comment iterate(records, () => {}) error does not appear

lifeart avatar Jan 27 '22 08:01 lifeart

@lifeart looks like from the comments there this might just be a leftover legacy thing?

RobbieTheWagner avatar Feb 07 '22 18:02 RobbieTheWagner

Looks like it's still used. :/

lifeart avatar Feb 07 '22 20:02 lifeart

@lifeart yeah, it might be used, but does it need to be used?

RobbieTheWagner avatar Feb 10 '22 16:02 RobbieTheWagner

I'm experiencing this today with the same environment. Any guidance on this?

csprocket777 avatar Mar 08 '22 23:03 csprocket777

@csprocket777 try to load all model types before opening ember-inspector

lifeart avatar Mar 09 '22 06:03 lifeart

burned a few hours trying to figure out the cause of this one as well :(

it's a bit of a double whammy because the tools you use to debug, like ember inspector, are the last thing you expect to be causing issues

Techn1x avatar May 26 '22 02:05 Techn1x

Does https://github.com/emberjs/data/pull/8008 fix this issue too for anyone? I did not see it anymore.

patricklx avatar Jun 17 '22 13:06 patricklx

Does https://github.com/emberjs/data/pull/8008 fix this issue too for anyone? I did not see it anymore.

I've been bitten by this multiple times, if this fix works I'd appreciate a backport to 3.2.x series. :pray:

mcfiredrill avatar Aug 03 '22 16:08 mcfiredrill

fhis has been fixed now in ember and ember data. The ember data fix has also been backported. The fix in ember might also be required. If you still see this issue comment on https://github.com/emberjs/ember.js/pull/20127 for a backport

patricklx avatar Oct 02 '22 09:10 patricklx