Skip to content

Flaky error "end is out of bounds" while working with <script setup> #1620

Description

@icehaunter

Version

3.0.0-rc.1

Reproduction link

https://github.com/icehaunter/vue3-setup-bug-repro

Steps to reproduce

  1. Clone repo, run npm i and run npm run dev
  2. Open the localhost:3000 in browser
  3. Open in editor the file src/components/HelloWorld.vue
  4. Edit <script setup> block adding and removing an enter multiple times, saving each time. Editing template by changing letters also works, but reproduces much slower.

What is expected?

Module is recompiled correctly every time

What is actually happening?

An error occurs in console:

[vite] SFC <script setup> compilation error:
/home/icehaunter/work/sltech/statecraft/src/components/HelloWorld.vue
end is out of bounds

An error occurs in the browser:

[Vue warn]: Component is missing template or render function. 
  at <HelloWorld msg="Hello Vue 3.0   Vite" > 
  at <App>

I basically initialized Vite application, switched to TypeScript and decided to try out the new <script setup> syntax. As far as I can tell, the error lies in Vue compiler and not in Vite, because Vite just prints out an error.

I could not reproduce the error with Vue CLI environment because I couldn't get it to process the <script setup> block at all.

  • Node version: 14.5.0
  • Typescript: 3.9.7
  • Vite: 1.0.0-rc.1

Activity

  1. icehaunter commented on Jul 18, 2020

    @icehaunter
    Author

    I tried recording a reproduction video. Here I repeatedly add and remove symbols from the line, saving the file each time, as you can tell from "reload" lines. I do not know whether the fact that component goes missing multiple times in the browser is the same bug or an error with Vite.

    test

  2. icehaunter commented on Jul 18, 2020

    @icehaunter
    Author

    I made a better reproduction demonstration, where editing <script setup> block causes many more errors and they appear much quicker. Am just adding/removing whitespace here.

    test

  3. locked and limited conversation to collaborators on Nov 8, 2023
  4. added a commit that references this issue on Jun 26, 2026
    8c0034d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions