Skip to content

Nested async components error when switching components #3448

Open
@taylorzane

Description

@taylorzane

Describe the bug

When nesting dynamic components that are imported via await import('/SomeComponent.js'), when the top-most component class is changed, the following error is thrown.

Logs

TypeError: undefined is not an object (evaluating 'outros.c')

(full traceback below)

To Reproduce

I was unable to reproduce this in the REPL (I assume it doesn't support dynamic imports), so here is a repro repository: https://github.com/taylorzane/svelte-async-import-repro

Just run yarn build && yarn start and then open up the webpage and attempt to click the button. It will switch the to-be-imported component from Child1 to Child2 (both of which dynamically import SubChild)

Expected behavior

The component switch/transition should not throw an error.

Stacktraces

Stack trace
[Error] Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'outros.c')
	transition_out (Child1.js:150)
	o (Child1.js:603)
	transition_out (bundle.js:165)
	p (bundle.js:358)
	p (bundle.js:455)
	update (bundle.js:126)
	flush (bundle.js:100)
	promiseReactionJob

Information about your Svelte project:

  • Your browser and the version: Safari 12.1.2

  • Your operating system: macOS 10.14.6

  • Svelte version: v3.9.1

  • Rollup

Severity

Currently makes multi-page (sapper) svelte usage entirely unusable.

Additional context

Might be related to #3165, but seems slightly different (outros is definitely defined)

Metadata

Metadata

Assignees

No one assigned

    Labels

    compilerChanges relating to the compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions