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

Await then without variable #188

Closed
PatrickG opened this issue Jun 13, 2020 · 3 comments
Closed

Await then without variable #188

PatrickG opened this issue Jun 13, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@PatrickG
Copy link
Contributor

Describe the bug
I'm getting the error Cannot read property 'end' of null when using the {:then} without a variable.

To Reproduce

<script>
  let promise;
</script>

{#await promise}
  Loading...
{:then}
  Loaded!
{/await}

Expected behavior
No error.

Screenshots
image

Additional context
Output:

Error walking node  {
  start: 35,
  end: 83,
  type: 'AwaitBlock',
  expression: Node {
    type: 'Identifier',
    start: 43,
    end: 50,
    loc: SourceLocation { start: [Position], end: [Position] },
    name: 'promise'
  },
  value: null,
  error: null,
  pending: {
    start: 51,
    end: 61,
    type: 'PendingBlock',
    children: [ [Object] ],
    skip: false
  },
  then: {
    start: 61,
    end: 75,
    type: 'ThenBlock',
    children: [ [Object] ],
    skip: false
  },
  catch: {
    start: null,
    end: null,
    type: 'CatchBlock',
    children: [],
    skip: true
  }
}
@PatrickG PatrickG added the bug Something isn't working label Jun 13, 2020
@swyxio
Copy link
Contributor

swyxio commented Jun 13, 2020

nice one. i put out a request for first time contributors as this is a good first issue. happy to help whoever tries to tackle this.

@skippednote
Copy link
Contributor

Hey there 👋
I've started looking into this and have raised a pull request #189.

@dummdidumm
Copy link
Member

Thanks @skippednote ! Fix should be available in about 12 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants