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

mount('*') fails after unregister #2573

Closed
karak opened this Issue Apr 14, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@karak
Contributor

karak commented Apr 14, 2018

Help us to manage our issues by answering the following:

  1. Describe your issue:

I met this during my unit-testing.

Unregister the tags once after register some tags and do stuff.
Then, register other tags and try to execute more tests with calling riot.mount('*'), when script stops and console says "Uncaught TypeError: Cannot read property 'class' of null".

Tracking the source code and I found mount('*') touches unregistered tags because selectTags gathers all the keys of __TAG_IMPL, while it still grabs the keys of unregistered tags.

I think two solutions to fix it -- I'm sorry I have no idea which is proper --

a. unregister do delete __TAG_IMPL[tagName] instead of __TAG_IMPL[tagName] = nulll
b. selectTags eliminates all the keys of null at first.

  1. Can you reproduce the issue?

Yes.

See https://jsfiddle.net/g0wcqyhy/8/

  1. On which browser/OS does the issue appear?

Chrome/Mac OS Hi Sierra
(Actually, NodeJS)

  1. Which version of Riot does it affect?

3.9.1

  1. How would you tag this issue?
  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@GianlucaGuarini

This comment has been minimized.

Member

GianlucaGuarini commented Apr 14, 2018

it was fixed in riot@3.9.2. Thank you for reporting it

@karak

This comment has been minimized.

Contributor

karak commented Apr 14, 2018

Thank you for so quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment