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

runtime error when get_current_component in on_mount #4864

Conversation

tanhauhau
Copy link
Member

Fixes #4259

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • Run the tests tests with npm test or yarn test)

@tanhauhau tanhauhau force-pushed the tanhauhau/error-when-use-get-current-component-in-onmount branch from 5c7049c to e5c9c8f Compare May 19, 2020 07:19
@Conduitry Conduitry marked this pull request as draft May 19, 2020 10:27
@rdb
Copy link
Contributor

rdb commented May 26, 2020

This unit test was not working correctly and raising an exception inside onMount seems to leave Svelte in an invalid state, which caused issues with the other unit tests. I've made an alternate version of this change with a correctly working unit test in #4909.

@tanhauhau tanhauhau closed this Aug 14, 2020
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.

Current component should (probably?) not be available inside onMount
2 participants