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

Fix undefined outros variable in transitions #5334

Closed
wants to merge 1 commit into from

Conversation

ryu-man
Copy link

@ryu-man ryu-man commented Aug 31, 2020

This error occures in the method transition_out when trying to use a component from external dependancy and wrapping it inside a <div in:{...} out:{...}/>.

  • The tests with npm test and lint the project with npm run lint was succesful

Error message: Cannot read property 'c' of undefined.

This error occures in the method transition_out when trying to use a component from external dependancy and wrapping it inside a <div in:{...} out:{...}/>.

Error message: Cannot read property 'c' of undefined.
@dummdidumm
Copy link
Member

Is it possible to add a otherwise failing test?

@ryu-man
Copy link
Author

ryu-man commented Nov 18, 2020

I solved it by adding an if(outros !=undefined) in svelte internal code before calling the variable , but i would say that in the current version (3.29.7) i am not seeing this problem any more.

@nergmada
Copy link

I am experiencing this issue in 3.29.7, can someone advise if this is going to merge?

@ryu-man
Copy link
Author

ryu-man commented Mar 24, 2021

@nergmada I use the latest version of svelte and I no longer see this problem, try to update your svelte package and check if it still exists.

@nergmada
Copy link

So I did a bunch more reading, and I think my issue (and maybe your issue because i'm guessing you compile your svelte components down to a single index.js with webpack at package/install time) is to do with how svelte/internals gets bundled with it. I don't entirely understand the inner workings of svelte, but my guess is that svelte internals (despite it's name) isn't completely self contained so two instances of it cause problems

I've linked the thread here. I've noticed this issue doesn't occur all the time and has a seemingly non-deterministic behaviour to it, because I don't always have an issue with destroying my compiled components

#3671 (comment)

@antony
Copy link
Member

antony commented Mar 24, 2021

This sounds like your config is not dedupe ing Svelte correctly, so it is a problem with your bundler configuration - I don't believe it needs patching in Svelte itself.

@antony antony closed this Mar 24, 2021
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

Successfully merging this pull request may close these issues.

4 participants