vite-plugin-vue2 icon indicating copy to clipboard operation
vite-plugin-vue2 copied to clipboard

vue template order affects debug breakpoints

Open kwesterfeld2 opened this issue 3 years ago • 7 comments

I am using the plugin and it works great if I order my SFCs with template followed by script tags. If I reverse this order, the generated source has one extra line at top. This makes setting debug breakpoints very challenging.

If I begin my script in this case like this:

kwesterfeld2 avatar Mar 09 '21 01:03 kwesterfeld2

Can you give me some screenshot for this?

underfin avatar Mar 19 '21 14:03 underfin

Got the same issue, the debug breakpoints is set one line below the actual location. Using vite 2.1.5 and vite-plugin-vue2 1.4.3. However, here I have <template> at top already.

https://cdn.discordapp.com/attachments/224497124379852800/829281179978563625/unknown.png x is undefined when it should'nt be. https://cdn.discordapp.com/attachments/224497124379852800/829281912819679232/unknown.png

vite:config bundled config file loaded in 413ms +0ms vite:config using resolved config: { vite:config plugins: [ vite:config 'vite:pre-alias', vite:config 'alias', vite:config 'purge-icons', vite:config 'vite:dynamic-import-polyfill', vite:config 'vite:resolve', vite:config 'vite:html', vite:config 'vite:css', vite:config 'vite:esbuild', vite:config 'vite:json', vite:config 'vite:wasm', vite:config 'vite:worker', vite:config 'vite:asset', vite:config 'vite-plugin-vue2', vite:config 'vite:define', vite:config 'vite:css-post', vite:config 'vite-plugin-components', vite:config 'vite:client-inject', vite:config 'vite:import-analysis' vite:config ], vite:config resolve: { vite:config dedupe: undefined, vite:config alias: [ vite:config [Object], [Object], vite:config [Object], [Object], vite:config [Object], [Object], vite:config [Object] vite:config ] vite:config }, vite:config server: { hmr: { port: 5001 } }, vite:config configFile: '.../Web/vite.config.js', vite:config inlineConfig: { vite:config root: undefined, vite:config base: undefined, vite:config mode: undefined, vite:config configFile: undefined, vite:config logLevel: undefined, vite:config clearScreen: undefined, vite:config server: {} vite:config }, vite:config root: '.../Web', vite:config base: '/', vite:config publicDir: '...\Web\public', vite:config command: 'serve', vite:config mode: 'development', vite:config isProduction: false, vite:config optimizeCacheDir: '...\Web\node_modules\.vite', vite:config build: { vite:config target: [ 'es2019', 'edge18', 'firefox60', 'chrome61', 'safari11' ], vite:config polyfillDynamicImport: true, vite:config outDir: 'dist', vite:config assetsDir: 'assets', vite:config assetsInlineLimit: 4096, vite:config cssCodeSplit: true, vite:config sourcemap: false, vite:config rollupOptions: {}, vite:config commonjsOptions: { include: [Array], extensions: [Array] }, vite:config minify: 'terser', vite:config terserOptions: {}, vite:config cleanCssOptions: {}, vite:config write: true, vite:config emptyOutDir: null, vite:config manifest: false, vite:config lib: false, vite:config ssr: false, vite:config ssrManifest: false, vite:config brotliSize: true, vite:config chunkSizeWarningLimit: 500 vite:config }, vite:config env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false }, vite:config assetsInclude: [Function: assetsInclude], vite:config logger: { vite:config hasWarned: false, vite:config info: [Function: info], vite:config warn: [Function: warn], vite:config error: [Function: error], vite:config clearScreen: [Function: clearScreen] vite:config }, vite:config createResolver: [Function: createResolver] vite:config } +7ms

BlueManiac avatar Apr 07 '21 09:04 BlueManiac

I can't reproduct for this, can you have a try after clear cache?

underfin avatar May 29 '21 10:05 underfin

Honestly now that you have sourcemaps working so well I think my breakpoints are working well. Wish my .js files in Vite worked this well.

KURT WESTERFELD // Yellowbrick Data


From: underfin @.> Sent: Saturday, May 29, 2021 6:43:40 AM To: underfin/vite-plugin-vue2 @.> Cc: Kurt Westerfeld @.>; Author @.> Subject: Re: [underfin/vite-plugin-vue2] vue template order affects debug breakpoints (#50)

I can't reproduct for this, can you have a try after clear cache?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Funderfin%2Fvite-plugin-vue2%2Fissues%2F50%23issuecomment-850812112&data=04%7C01%7Ckurt.westerfeld%40yellowbrick.com%7Ccc53701953484ff492da08d9228e9fe4%7C912d4ba33f81477a90c6caa2ee5521db%7C0%7C0%7C637578818255632313%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mfP%2FwrUtxxXT7VGMrEMUHAgp5FVDAZu5dpbmYBJG4xs%3D&reserved=0, or unsubscribehttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJC6YIVVONTFRAXJVNCNZGDTQDANZANCNFSM4Y2QD75Q&data=04%7C01%7Ckurt.westerfeld%40yellowbrick.com%7Ccc53701953484ff492da08d9228e9fe4%7C912d4ba33f81477a90c6caa2ee5521db%7C0%7C0%7C637578818255642308%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=N8n1Yrl%2BaNd2%2FTWmOnnk59wdJVHO2iAAnagwCm40ITw%3D&reserved=0.

kwesterfeld2 avatar May 29 '21 17:05 kwesterfeld2

cleared both vite cache and browser cache still same issue. using vite 2.2.4 and vite-plugin-vue2 1.5.2

BlueManiac avatar May 31 '21 07:05 BlueManiac

@BlueManiac can you give some reproduction for this?

underfin avatar Jun 03 '21 15:06 underfin

This seems to be resolved for me now using vite 2.5.0 and vite-plugin-vue2 1.8.1 so this can probably be closed now.

BlueManiac avatar Aug 16 '21 12:08 BlueManiac