Skip to content

Using delete property throws an error #28

Description

@degloman

Please provide the environment you discovered this bug in.

https://stackblitz.com/edit/stackblitz-starters-7n7wzd?file=src%2Fmain.ts,src%2Ftoast.component.ts

Description

In the ExternalToast options, there is a delete property intended for closing the toast.
However, setting this property to true results in an error.

P.S. Ideally I guess it would be better to have the instance of the ToastComponent instead of just id on the toast creation so it will allow us to call the deleteToast() function to keep the animation.

Please provide the exception or error you saw

:43 RuntimeError: NG0600: Writing to signals is not allowed in a `computed` or an `effect` by default. Use `allowSignalWrites` in the `CreateEffectOptions` to enable this inside effects.
    at core.mjs:31124:15
    at throwInvalidWriteToSignalError (signals.mjs:407:5)
    at signalSetFn (signals.mjs:444:9)
    at signalFn.set (core.mjs:16485:34)
    at _ToastComponent.deleteToast (ngx-sonner.mjs:992:18)
    at EffectHandle.effectFn (ngx-sonner.mjs:973:14)
    at EffectHandle.runEffect (core.mjs:36124:18)
    at Object.fn (core.mjs:36119:58)
    at Object.run (signals.mjs:514:18)
    at EffectHandle.run (core.mjs:36134:22)

Other information

No response

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

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions