Is there a way to access and troubleshoot the complete source code within .vue files?

I've been struggling for hours trying to understand why I'm unable to view the full source of my .vue files in the Chrome debugger. When I click on webpack://, I can see the files listed there like they are in my project tree, but when I try to open them, the actual source code doesn't display.

At the end of each file, there is a common line that reads

component.options.__file = "src/foldername/foldername/foo.vue"

I have made numerous changes to my vue.config.js file, with the most important line being:

config.devtool = 'cheap-module-source-map'

Additionally, at the bottom of my Chrome dev-tools window, it shows

'source mapped from app.1df89b9.js'

Below is the complete block of my vue.config.js:

const CopyModulesPlugin = require('copy-modules-webpack-plugin')
module.exports = {
    publicPath: process.env.BASE_URL,
    configureWebpack:
    config => {
        config.devtool = 'cheap-module-source-map';
        config.plugins = [
        new CopyModulesPlugin({
            destination: 'webpack-modules'
        }),
            ...config.plugins
            ];
            config.module.rules = [
            {
                test: /\shared\.worker\.ts$/,
                loader: 'worker-loader',
                options: {
                    worker: {
                        type: 'SharedWorker',
                        options: {
                            type: 'classic',
                            credentials: 'include',
                            name: 'birdman-shared-worker'
                        }
                    }
                }
            }, {
                test: /(?<!\.shared)\.worker\.ts$/,
                loader: 'worker-loader',
                options: {
                    worker: {
                        type: 'Worker'
                        options: {
                            type: 'classic',
                            credentials: 'include',
                            name: 'birdman-worker'
                        }
                    }
                }
            },
            ...config.module.rules];
    }

Answer №1

Occasionally, the sources-map file may fail to parse. In such cases, it is recommended to clear the cache, refresh, and try again. If the issue persists, consider changing the config.devtool value to inline-source-map.

Answer №2

As per the information provided in the Webpack documentation, it is highlighted that cheap-module-source-map falls under the category of special cases. It is advisable to opt for one of the recommended values for development unless there exists a specific requirement necessitating otherwise.

Upon reviewing your source map briefly, it appears to be functioning correctly. Nonetheless, as mentioned in this comment, you may consider implementing some code enhancements to improve the visibility of your source map files:

In my case, although the source maps were operational, they were somewhat buried among other files, making them challenging to locate. The method I utilized helped segregate the "authentic" ones from the clutter. My project setup aligns with the standard configuration utilizing Vue-CLI, Vue 3, and TypeScript.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for uploading information to a web service

Issue Description:- I am attempting to access web services from a different domain (i.e. Systems are not locally connected) and encountering the following error: "Failed to load : Response for preflight is invalid (redirect)" var username = "<a href= ...

Retrieving POST data from requests in Node.js

My goal is to extract parameters from a POST request and store them in the variable postData using the request module. I found helpful information on handling post requests with Express.js here. Additionally, I came across this useful thread on how to retr ...

Unable to include Buefy or Bulma in a Vuejs project

I am working on a Vue.js project and I would like to incorporate the Bulma framework and possibly Buefy as well. To start, I used the commands npm install bulma and npm install buefy In the main.js file, my setup looks like this: import Buefy from &apos ...

Having trouble accessing functions within the webpack bundle

As someone new to the world of JS library development, I have embarked on a journey to achieve the following goals: Creating a library with TypeScript Generating a bundle using webpack5 Publishing the library to npm Utilizing the library in other projects ...

Create and release an NPM package using two different design patterns

I have a package that is compiled into a UMD format using Typescript and then transformed into global variables using Webpack. I need to stick with Typescript, so a more flexible UMD pattern is not possible. The goal is to allow applications consuming the ...

Fixed width for the last column in DataTables

Here's the scenario: I have a jQuery script that loads DataTables, and I know how to set the "aoColumns" : "sWidth" parameter to fix the width of a specific column, which is working fine. However, my issue arises from having multiple tables with var ...

Is there a way to manipulate a button's toggle state using Javascript as the page loads?

I am in the process of developing a straightforward web application that allows users to customize their settings. On the settings page, there are several toggle buttons that need to have their state changed during the page load to align with the preferenc ...

JQuery: Issues with attaching .on handlers to dynamically added elements

I'm currently developing a comment system. Upon loading the page, users will see a box to create a new comment, along with existing comments that have reply buttons. Clicking on a reply button will duplicate and add the comment text box like this: $( ...

How can I close the menu when a menu item is clicked in a React.js application?

I am facing an issue where I want to close the menu when clicking on any menu item in React JS. The functionality works fine with a button icon but not with individual menu items. How can I resolve this problem? I have been trying to implement it using CSS ...

Plotting Data Points with Tags in React Native

After doing some research, I came across a few React Native packages that offer scatter plots such as react-native-scatter-chart, react-native-chart-kit, and react-native-chartjs. However, I am interested in finding something more customizable. I'm s ...

Tips for handling catch errors in fetch POST requests in React Native

I am facing an issue with handling errors when making a POST request in React Native. I understand that there is a catch block for network connection errors, but how can I handle errors received from the response when the username or password is incorrec ...

Discovering checkboxes in HTML using jQuery

Greetings! I have limited knowledge when it comes to using jQuery. I am currently facing an issue with the Checkbox attribute. Below, you will find the code snippet that I have mentioned: Code: $( this ).html() Output: <input name="cb_kot[]" class= ...

Retrieving data from the Vuex store in a Nuxt component

https://i.stack.imgur.com/htnuL.png Seeking guidance on passing a list of button names into a menu component from the Vuex store as per the instructions at https://nuxtjs.org/guide/vuex-store In my /store/store.js: export const state = () => ({ & ...

Can using the jQuery.clone method impact other functions?

Assuming $dom is a jQuery element, can the following line be safely removed if a is not utilized thereafter? var a = $dom.clone(true,true); When using $dom.clone(false,false), it appears that there are no side effects. I believe this method doesn't ...

Reveal unseen information on the webpage upon clicking a link

I have successfully implemented a fixed header and footer on my webpage. The goal is to make it so that when a user clicks on a link in either the header or footer, the content of that page should appear dynamically. While I have explored various styles, ...

"Looking to access your Express app in a VM from the internet? Here's how

I have an express app running on a Node.js server hosted on Azure Linux VM, and I am looking to access this website from my personal computer. const express = require('express'); const app = express(); app.listen(3000, () => { console.lo ...

Contrasting Template Helper and Template Variable in Meteor.js

What sets apart the use of a Template Helper from a Template Variable (if that's not the right term)? How do you determine when to utilize each one? In the following example, both Template.apple.price function and the quantity function in Template.ap ...

Ignore one specific file when importing all files in Angular 7

In my Angular 7 project, I am utilizing C3 and importing all the necessary files at the beginning of my .ts component file using a wildcard. import * as c3 from 'c3'; While this method works well overall, I encountered an issue where my CSS ove ...

Looking for assistance with removing hardcoding in HTML and jQuery?

Currently working on a biography page for my company's website that features a grid layout of the employees' profile pictures. Each picture should be clickable, causing the screen to fade to gray and display an overlay with the respective person& ...

Unable to implement a function from a controller class

I'm currently attempting to organize my Express.js code, but I've hit a snag when trying to utilize a class method from the controller. Here's an example of what my code looks like: product.service.ts export class ProductService { constr ...