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

🐞 - v3 experimental TuiSegmented throws error on initialization #9758

Open
dequubi opened this issue Nov 14, 2024 · 1 comment
Open

🐞 - v3 experimental TuiSegmented throws error on initialization #9758

dequubi opened this issue Nov 14, 2024 · 1 comment
Labels
contributions welcome Architecture is clear and community can help

Comments

@dequubi
Copy link

dequubi commented Nov 14, 2024

Reproduction url

https://stackblitz.com/edit/stackblitz-starters-pf2rkh?file=src%2Fmain.ts

Description

After updating from 3.94 to 3.98, tui-segmented component started throwing the following error on initialization

ERROR TypeError: Cannot read properties of undefined (reading 'valueChanges')

Stack trace leads to the following code

// node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-observables.js
function tuiControlValue(control) {
  return new Observable((subscriber) => {
    if (!control.valueChanges) { // <--
      throw new TuiValueChangesException();
    }
    return control.valueChanges.pipe(startWith(control.value)).subscribe(subscriber);
  });
}

May be caused by #9074?

Taiga UI version

3.98.0

Browser Used

Chrome

OS Used

Windows

@nsbarsukov
Copy link
Member

Optional chaining should be added for this case

@nsbarsukov nsbarsukov added the contributions welcome Architecture is clear and community can help label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome Architecture is clear and community can help
Development

No branches or pull requests

2 participants