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

From 3.6.0: "TypeError: Cannot read property 'block' of null" #3113

Closed
frederikhors opened this issue Jun 25, 2019 · 10 comments · Fixed by #3172
Closed

From 3.6.0: "TypeError: Cannot read property 'block' of null" #3113

frederikhors opened this issue Jun 25, 2019 · 10 comments · Fixed by #3172
Labels

Comments

@frederikhors
Copy link

I'm using it with svelte-apollo but I cannot create now reproduction on codesandbox.

Uncaught (in promise) TypeError: Cannot read property 'block' of null
    at Object.destroy [as d] (PlayersPage.svelte:14)
    at destroy_component (index.mjs:1185)
    at App.svelte:31
    at index.mjs:633
    at run (index.mjs:18)
    at Array.forEach (<anonymous>)
    at run_all (index.mjs:24)
    at check_outros (index.mjs:615)
    at Object.update [as p] (App.svelte:31)
    at update (index.mjs:586)

Maybe something related to Object.destroy from 3.6.0 (#3058)?

@radarsh
Copy link

radarsh commented Jun 26, 2019

I can confirm this. Downgrading to 3.5.4 fixes the issue. I am using page.js for routing and 3.6.0 breaks it.

@Conduitry
Copy link
Member

We'll need a repro to debug this. It doesn't have to be on codesandbox, it can be a git repo.

Is this still present on the latest version?

@Conduitry Conduitry added the awaiting submitter needs a reproduction, or clarification label Jul 2, 2019
@frederikhors
Copy link
Author

I cannot create gist now. The problem is still on 3.6.2 (I try every time new Svelte versions).

Downgrading to 3.5.4 fix the issue also for me.

@PaulMaly
Copy link
Contributor

PaulMaly commented Jul 3, 2019

I also caught this issue. Seems it somehow depends on #3058

@PaulMaly
Copy link
Contributor

PaulMaly commented Jul 3, 2019

After a small investigation, I'm sure it also depends on {#await /} block.

@frederikhors
Copy link
Author

@Conduitry, I have a reproduction: https://codesandbox.io/s/vigilant-cache-4rtqy

Open browser console, not the codesandbox's one.

@radarsh, @PaulMaly can you confirm it is the same problem?

@radarsh
Copy link

radarsh commented Jul 3, 2019

@frederikhors yup, same error.

image

@Conduitry
Copy link
Member

Reduced repro: A <svelte:component> that displays a component with an {#await} block.

App.svelte

<script>
  let flag = false;
  import Widget from './Widget.svelte';
</script>

<input type='checkbox' bind:checked={flag}>

<svelte:component this={flag && Widget}/>

Widget.svelte

{#await null}{/await}

Toggling the checkbox on and off to display and destroy the child component throws this exception.

@Conduitry Conduitry added bug and removed awaiting submitter needs a reproduction, or clarification labels Jul 3, 2019
Rich-Harris added a commit that referenced this issue Jul 4, 2019
Rich-Harris added a commit that referenced this issue Jul 9, 2019
Rich-Harris added a commit that referenced this issue Jul 9, 2019
prevent dynamic components being detached twice
@Rich-Harris
Copy link
Member

Auto-closed by #3172, but re-opening because the repro at https://codesandbox.io/s/vigilant-cache-4rtqy is still buggy

@Rich-Harris Rich-Harris reopened this Jul 9, 2019
@Rich-Harris
Copy link
Member

I take it back, it does appear to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants