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

Using delete property throws an error #28

Open
2 tasks
degloman opened this issue Oct 30, 2024 · 0 comments
Open
2 tasks

Using delete property throws an error #28

degloman opened this issue Oct 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@degloman
Copy link

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
@degloman degloman added the bug Something isn't working label Oct 30, 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

1 participant