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

[Question] why rx-angular/state throw error "wrong params passed to select" when use cloneDeep function of lodash to clone a complicated object #1701

Open
xiongxiong113 opened this issue Mar 12, 2024 · 3 comments

Comments

@xiongxiong113
Copy link

Description

I encounter a very strange issue:
When I update rx-angular/state to version 16.3.0, I use lodash( version 4.17.21) cloneDeep function to clone a complicated object, The structure of this object is roughly as follows:
image

Among them, PersonComponent is a relatively complex component, and each item in ele is based on ref and portal of different components.

Then, we use cloneDeep function to clone this object, sometimes we will get the error message like this:
image
image

It is not 100% reproducible, sometimes the clone is successful.
But when I drop the version back to 1.7.0, cloneDeep function succeeds every time without throwing an error.

Environment

Node: 18.18.0
OS: win x64

Angular: 16.2.0

Package Version

@rx-angular/state ~16.3.0
lodash ^4.17.21
rxjs ~7.8.0
typescript 5.1.3

@hoebbelsB
Copy link
Member

I'm not 100% sure if I understand the issue correctly.

Are you using cloneDeep on a Component that has a local rxState instance and after the cloning the instance is dead?

Or how does your code look like? I need a bit more information to give a proper answer

@Lornot
Copy link

Lornot commented Aug 5, 2024

It's the same issue for me. I don't use rx-angular in the component (I use and import it in other modules), but cloneDeep of the form in the component leads to this error.
Maybe it selects some form valueChanges that are not observables anymore after cloneDeep.

@hoebbelsB
Copy link
Member

Could you give me a little bit of insight about how the code looks like? The error being thrown refer to a broken select call, but I still don't fully understand how everything is connected.

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

3 participants