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

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

Closed
icehaunter opened this issue Jul 18, 2020 · 2 comments
Closed
Labels
🐞 bug Something isn't working scope: sfc

Comments

@icehaunter
Copy link

icehaunter commented Jul 18, 2020

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
@icehaunter
Copy link
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

@icehaunter
Copy link
Author

icehaunter commented Jul 18, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: sfc
Projects
None yet
Development

No branches or pull requests

2 participants