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

JS/KO error '$index is not defined' in Settings > Accounts #1797

Closed
SergeyMosin opened this issue Oct 9, 2024 · 2 comments
Closed

JS/KO error '$index is not defined' in Settings > Accounts #1797

SergeyMosin opened this issue Oct 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@SergeyMosin
Copy link

Describe the bug
Clicking on the Accounts tab in the Settings does not work on the first try in v2.38.1

Details
Browser console error:

Uncaught ReferenceError: Unable to process binding "template: () => ({ name: RoutedSettingsViewModel.template })"
Message: Unable to process binding "foreach: ()=>(identities)"
Message: Unable to process binding "visible: ()=>(0 === $index())"
Message: $index is not defined

This is most like a regression from c14bbab

Possible fix is to replace this:

<span class="identity-default" data-bind="visible: 0 === $index()" data-i18n="GLOBAL/DEFAULT"></span>

with something like this:

<span class="identity-default" data-bind="visible: id() === ''" data-i18n="GLOBAL/DEFAULT"></span>

only secondary identities have ids

@the-djmaze
Copy link
Owner

I had the same error once and never again.
Will try to replicate and see what causes it.

@the-djmaze the-djmaze added the bug Something isn't working label Oct 9, 2024
@the-djmaze
Copy link
Owner

the-djmaze commented Oct 9, 2024

Although it is fixed, i might have a better approach for the deprecated with statement.
It also makes the template bindings much more secure.

I have to test this change how much it will impact the speed.
904a353

the-djmaze pushed a commit that referenced this issue Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants