fix: out transition function when config is undefined #7906
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes #7904
As stated on the issue, when performing quick actions, the Svelte will throw an Exception and stop working (
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'tick')
)Investigating the problem, the
config
object on thecreate_out_transition
function isundefined
, so callingconfig.tick()
will throw this exception. I added the?.
operator so it would call thetick
function just if it is defined.After that was solved, another issue emerged, but it was related to the
detach
function ondom.ts
file. It was callingremoveChild
from aparentNode
, butparentNode
wasnull
(node.parentNode?.removeChild(node);
). I added the?.
operator so it would remove the child just if the parent node exists.Before submitting the PR, please make sure you do the following
[feat]
,[fix]
,[chore]
, or[docs]
.Tests
npm test
and lint the project withnpm run lint