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

A special bug that occurs when using 【script setup】 #1761

Closed
3 tasks done
zhenzhenChange opened this issue Jan 28, 2021 · 4 comments
Closed
3 tasks done

A special bug that occurs when using 【script setup】 #1761

zhenzhenChange opened this issue Jan 28, 2021 · 4 comments

Comments

@zhenzhenChange
Copy link
Contributor

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)
  • If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.

Describe the bug

As soon as I import into SFC in this order as 【{ defineEmit, defineProps, inject }】, I get this problem.

Other than that, there are no errors

code

bug

Reproduction

This problem is easy to reproduce, just follow the order on the chart to import

System Info

  • vite version: v2.0.0-beta.52
  • Operating System: Windows10 x64
  • Node version: v15.2.0
  • Package manager (npm/yarn/pnpm) and version: yarn v1.22.5

pkg

Logs (Optional if provided reproduction)

debug

@CHOYSEN
Copy link
Contributor

CHOYSEN commented Jan 28, 2021

vuejs/core#2740

@zhenzhenChange
Copy link
Contributor Author

vuejs/vue-next#2740

Thanks for your attention, but the current version will still have this problem hey hh

@patak-dev
Copy link
Member

patak-dev commented Jan 28, 2021

There are open PRs for this issue in vue-next (vuejs/core#2729), and as @CHOYSEN this issue is already tracked in the vue next repo. @zhenzhenChange this is not an issue with Vite.

A workaround is changing the order of imports, so that defineEmit and defineProps are trailing.

@zhenzhenChange
Copy link
Contributor Author

I understand, now close it, thank you all

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants