Closed Xenoha closed 2 years ago
Hey there @sodatea , just wanted to follow-up on this issue? Thanks
@Xenoha I think https://github.com/vitejs/vite/pull/4984 fixed this.
@sapphi-red
Thanks for the update. I just updated to Vite: 2.3.6 and it looks like I can now see the setup contents. However, I still see my components named as "Anonymous Component" with the 6.1.4 Devtools Version and the "Allow access to file Url's checked.
@Xenoha Have you set __VUE_PROD_DEVTOOLS__
using define
like below?
// vite.config.js
export default {
define: {
__VUE_PROD_DEVTOOLS__: true
}
}
@sapphi-red
export default defineConfig({ define: { __VUE_PROD_DEVTOOLS__: true, }, plugins: [vue(), windiCSS()], base: './', css: { postcss: { from: undefined } }, build: { chunkSizeWarningLimit: 5000, minify: APP_ENV === 'production' ? 'terser' : false, sourcemap: APP_ENV === 'production' ? false : true, brotliSize: APP_ENV === 'production' ? true : false, terserOptions: { format: { comments: false }, }, watch: APP_ENV === 'production' ? null : { exclude: ['node_modules/**'], include: 'src/**', skipWrite: true, }, }, resolve: { alias: { '@/': new URL('./src/', import.meta.url).pathname } }, });
I should add that I still don't have the __file property when running the vm.type
command. The property 'setup' is the only one available when selecting an "Anonymous Component."
Moreover, I did a test and used the regular "script" syntax with the name and setup properties. This component shows correctly in the Devtools. It seems very much '__File' referencing when using the new script setup SFC.
Thanks @sodatea , I'll follow that issue and see if your update fixes the 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
Used Package Manager
pnpm
Logs
Validations