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

Async SFCs with <script setup> issue when using single-line if statement with top level await #1874

Closed
dsine-de opened this issue Sep 15, 2021 · 2 comments

Comments

@dsine-de
Copy link

Version

16.4.1

Reproduction link

github.com

Steps to reproduce

Clone the reproduction repository, run npm i and npm run dev and then open http://localhost:8080/ while viewing the JavaScript console output.

What is expected?

The console.error() in vue/child.vue should never be executed because the if-condition before the await is always false.

What is actually happening?

The console.error() is being executed when the if statement is written as a single-line (if-statement with curly brackets works though).


It's possible that it's actually an issue with babel / babel-loader or vue and not vue-loader.

@dsine-de
Copy link
Author

I removed all packages related to babel and eslint and the issue still persists.

@dsine-de
Copy link
Author

dsine-de commented Sep 15, 2021

I opened an issue on the vue-next repository since this probably isn't a issue of the loader itself: vuejs/core#4596

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

No branches or pull requests

1 participant