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

<script setup lang="js"> compiles to a different result with <script setup> #7388

Closed
sapphi-red opened this issue Dec 21, 2022 · 0 comments · Fixed by #7398
Closed

<script setup lang="js"> compiles to a different result with <script setup> #7388

sapphi-red opened this issue Dec 21, 2022 · 0 comments · Fixed by #7398

Comments

@sapphi-red
Copy link
Contributor

Vue version

3.2.45

Link to minimal reproduction

https://stackblitz.com/edit/node-iqu5zb?file=index.js

Steps to reproduce

  1. Open stackblitz
  2. npm i (automatically runs)
  3. npm start (automatically runs)

What is expected?

export default {
  setup(__props, { expose }) {
  expose();

const foo = 'foo';

const __returned__ = { foo }
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })
return __returned__
}

}

is output. (This output is the result without lang="js")

What is actually happening?

const foo = 'foo';

is output.

System Info

No response

Any additional comments?

I found this while digging around vitejs/vite-plugin-vue#17.

If <template lang="html"> should work (#6929), I think <script setup lang="js"> should also work.

@sapphi-red sapphi-red changed the title <script setup lang="js"> compiles to different result with <script setup> <script setup lang="js"> compiles to a different result with <script setup> Dec 21, 2022
sxzz added a commit that referenced this issue Dec 22, 2022
sxzz added a commit that referenced this issue Jan 26, 2023
sxzz added a commit that referenced this issue Feb 1, 2023
sxzz added a commit that referenced this issue Feb 4, 2023
sxzz added a commit that referenced this issue Mar 27, 2023
sxzz added a commit that referenced this issue Mar 28, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants