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

Internal server error: [@vue/compiler-sfc] <script> and <script setup> must have the same language type. #575

Closed
3 tasks done
ljcremer opened this issue Mar 9, 2022 · 4 comments
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@ljcremer
Copy link

ljcremer commented Mar 9, 2022

Describe the bug

I am trying to use vue inside the markup but it seems like I cannot use typescript

Reproduction

If I add the following line in my markup file I get the error:

<script setup lang="ts">

Expected behavior

Would like to use typescript in the markdown if possible.

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 7.01 GB / 15.85 GB
  Binaries:
    Node: 14.17.5 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 7.20.6 - ~\AppData\Roaming\npm\npm.CMD
  Browsers:
    Chrome: 99.0.4844.51
    Edge: Spartan (44.22000.120.0), Chromium (99.0.1150.30)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    vitepress: ^0.22.3 => 0.22.3

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@ljcremer ljcremer added the bug: pending triage Maybe a bug, waiting for confirmation label Mar 9, 2022
@LinusBorg
Copy link
Member

We use Vitepress, script setup and typescript for the vuejs.org docs, so it definitely is possible.

You need to share a reproduction, at the very least the code throwing an error.

@ljcremer
Copy link
Author

ljcremer commented Mar 9, 2022

Thanks Linus. I will have to do a bit of work to publish a reproduction.

Is the script setup typescript done in the markdown file?

In the meantime can you maybe give me a link to a page where this is done in the documentation?

@LinusBorg
Copy link
Member

Oh, you add that in a markup file - I totally missed that part, my bad. That might indeed not be well supported right now.

A real reproduction would nonetheless be welcomed.

@posva
Copy link
Member

posva commented Apr 8, 2022

You need to close the <script>. If that's not it create a new issue with a boiled down repro.

@posva posva closed this as completed Apr 8, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants