dennisreimann / uiengine

Workbench for UI-driven development
https://uiengine.uix.space/
MIT License
366 stars 25 forks source link

fix debug for unparsable state.config #25

Closed 941design closed 6 years ago

941design commented 6 years ago

Cannot destructure property debug of 'undefined' or 'null'.

occurred when state.config == undefined

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.04%) to 92.367% when pulling 8d1d7af8b9a9a06afb19678c5b9d13208a9ba2a5 on 941design:master into 1015206621923c0530610371cd02deb1df68fc64 on dennisreimann:master.

dennisreimann commented 6 years ago

Hi and thanks for the contribution!

Can you elaborate on how this happened to you? state.config should not be undefined and I‘d like to fix the cause of that.

941design commented 6 years ago

state is parsed inside try block: https://github.com/dennisreimann/uiengine/blob/v1.0.6/packages/core/src/core.js#L39 finally block passes state to debug2: https://github.com/dennisreimann/uiengine/blob/v1.0.6/packages/core/src/core.js#L72 debug2 relies on _state.config to be set: https://github.com/dennisreimann/uiengine/blob/v1.0.6/packages/util/src/debug.js#L4