Platform: Detected unserializable action at...

Created on 9 Jul 2019  路  6Comments  路  Source: ngrx/platform

Minimal reproduction of the bug/regression with instructions:

If you click 'Trigger Unserializable Action' and have a look in the console you will see the error, with strictActionSerializability set to true in app.module.ts. Full example:

https://stackblitz.com/edit/ngrx-unserializable-action-bug

Expected behavior:

There are no unserializable types in the action I am dispatching. I wouldn't expect any errors.

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):

NgRx: 8.0.1
Angular: 8.0.3
Browser: Chrome 75

Other information:

I would be willing to submit a PR to fix this issue

[ X ] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

Most helpful comment

Correct @bfwg

All 6 comments

A class instance is unserializable.
You can solve this by spreading it into a JS object:

const toSend = {...new UpsertUserSkillsModel('84c4e12e-af62-4772-9386-ef9af46f88d8', model)};

Hi @Samywamy10 , do you happen to know how to work with File type Action parameters? I'm trying to do

    this.store.dispatch(PromotionActions.uploadFile({file: file}));

I tried the spreading method but no luck.

@bfwg a File is not serializable.

So there is no way to pass a File as the parameter of an Action while the strictActionSerializability is true?

Correct @bfwg

Thanks!

Was this page helpful?
0 / 5 - 0 ratings