qgis / qwc2-demo-app

QWC2 demo application
Other
240 stars 149 forks source link

_this.props.theme is undefined #515

Closed danceb closed 5 months ago

danceb commented 5 months ago

Since https://github.com/qgis/qwc2/commit/bc17a8d The map is not loaded anymore and clicking in the search bar brings the error

_this.props.theme is undefined
SearchBox/<@webpack://QWC2App/./qwc2/components/SearchBox.jsx?:691:36
SearchBox/<@webpack://QWC2App/./qwc2/components/SearchBox.jsx?:643:15
manisandro commented 5 months ago

Can you show which line of code this corresponds to? Unfortunately line 691 does not correspond to the actual line in the source code.

danceb commented 5 months ago

https://github.com/qgis/qwc2/blob/master/components/SearchBox.jsx#L576

The commit isn't the right one, couldn't find at the moment, where it was introduced.

manisandro commented 5 months ago

This is curious, looks as if a search is triggered before a theme is loaded. Can you also show the other real lines of the stack trace?

danceb commented 5 months ago

https://github.com/qgis/qwc2/blob/master/components/SearchBox.jsx#L576 https://github.com/qgis/qwc2/blob/master/components/SearchBox.jsx#L544

manisandro commented 5 months ago

I suspect an optimization uncovered a potential race condition - can you test whether [1] fixes it?

[1] https://github.com/qgis/qwc2/commit/adc0a47d288ef124146c61a6ab1be4593a7d19a1

danceb commented 5 months ago

mh, actually no. The theme is still not loaded. The Error does not appear anymore while clicking within the search box instead it appears if I start typing something.

manisandro commented 5 months ago

Can you send me your themes.json?

danceb commented 5 months ago

themes.json

Very strange... The issues only occurs with the theme "Start". Everything works with the second theme "Baustellen". In addition if I am switching to the "Start" theme, I am getting the error

bounds is undefined

which is related to https://github.com/qgis/qwc2/blob/adc0a47/utils/LayerUtils.js#L944

manisandro commented 5 months ago

Should be fixed in https://github.com/qgis/qwc2/commit/d870b4d5fc4784c03b0a39b2453f9bd54799fc6b