question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setup SFC doesn't compile development with development flag "_file" when component is process for devtools to show setup function

See original GitHub issue

Describe the bug

Steps to reproduce Pull the repo, or just follow the getting started steps with pnpm. While I provided the vitesse starting repo with pnpm, you could use the vite repo with yarn as well. See the below for details from both project starts paths.

On Viteese: If you just do a build with the standard starting code, then do a “pnpm preview” you will see the devtools and your layout will be Anonymous Component and the Page will be Anonymous Component.

On Vite: If you do a build with the standard starting code. Change the dev script to the following: '“dev”: “vite build --watch --mode ‘development’” Open up your chrome devtools and note that the Vue devtools should be present as you changed the mode to “development” When reviewing the component structure of the devtools, none router based components show up as Anonymous Component

What is expected? The component file name should be visible through the devtools component tree as well as the setup properties.

What is actually happening? The component is showing up as “Anonymous Component” and the setup method properties are not visible for the component.

Please let me know if I should submit this issue elsewhere as as always, thank you for the support.

Reproduction

github.com/antfu/vitesse

System Info

System:
    OS: Linux 5.13 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
    Memory: 11.10 GB / 31.20 GB
    Container: Yes
    Shell: 5.0.3 - /bin/bash
  Binaries:
    Node: 14.17.5 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.14.14 - /usr/local/bin/npm
  npmPackages:
    @vitejs/plugin-vue: ^1.2.3 => 1.6.2 
    vite: ^2.3.6 => 2.5.6

Used Package Manager

pnpm

Logs

See background in Devtools issue https://github.com/vuejs/devtools/issues/1564
See background in Vue Core issue https://github.com/vuejs/core/issues/5365

Per Linus
"This is an issue with vite's plugin, which only adds this property if the dev-server is running:"

https://github.com/vitejs/vite/blob/5306234aad7e7432fb55c6033a63c6cf74493c3f/packages/plugin-vue/src/main.ts?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L105-L108

Validations

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sodateacommented, Apr 19, 2022
0reactions
Xenohacommented, Apr 19, 2022

Thanks @sodatea , I’ll follow that issue and see if your update fixes the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SFC Scannow Not Working on Windows (Solved) - STechies
But if SFC does not work and fails to run, it may show an error message like this ... Run DISM Scan; Repair...
Read more >
How To Debug Components, State, and Events with Vue.js ...
Step 1 — Setting Up the Example Application · Step 2 — Installing Vue Devtools · Step 3 — Using the Devtools Interface...
Read more >
Common mistakes to avoid while working with Vue.js
Note that this issue doesn't occur when you define templates with the render function or SFC (Single File Component).
Read more >
Vue 3.2 - Using Composition API with Script Setup
Introduction Vue 3 introduced the Composition API as a new way to work with reactive state in a Vue application. Rather than organizing...
Read more >
Quick Start - Vue.js
The created project will be using a build setup based on Vite and allow us to use Vue Single-File Components (SFCs). Make sure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found