Skip to content
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

Explore your area not loading properly #609

Open
StefanVanDyck opened this issue Jul 31, 2024 · 1 comment
Open

Explore your area not loading properly #609

StefanVanDyck opened this issue Jul 31, 2024 · 1 comment

Comments

@StefanVanDyck
Copy link

StefanVanDyck commented Jul 31, 2024

We were having issues getting the explore-your-area page to work.
It seemed to be stuck "loading".
Screenshot from 2024-07-31 12-46-52

Debugging a little seems to indicate this is because the code never manages to load the translation messages.
Meaning it never exits this loop.

Reason is the BC_CONF global config is not updated properly.
Screenshot from 2024-07-31 12-48-54

Because in the app.js script (not sure how that is generated) the BC_CONF global is already initialized to:
{autocompleteURL: 'https://species-ws.biodiversiteitsportaal.dev.svdev.be/search/auto.json'}
Screenshot from 2024-07-31 12-48-30

And therefor this if-statement always evaluates as false.

Working on a quick-fix workaround for our purposes by just updating the BC_CONF in some extra JS script I can inject.

If you would like, I can try an open a PR with a suggestion for a fix.

Also, it might be a good idea to add some logging to the init loop, so it becomes a bit more obvious when something is wrong with the loading.

The way the BC_CONF global is being used seems a little dangerous as well.
Maybe a longer term idea could be to make it more of a read-only immutable by extracting it to a separate module that is required everywhere else. 🤷
That way the order of loading in the code should not affect the behavior.

Thank you! 🙇

@adam-collins
Copy link
Contributor

PRs welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants