Troubleshooting errors in a Vue.js TypeScript project using WebStorm, the debugger fails to halt at designated break points

I recently started a new project in WebStorm using TypeScript settings, but for some reason the debugger break point isn't working.

My configuration

Version

  • Node 12.10
  • Vue/CLI 3.11.0

Project setup

  1. Babel
  2. TypeScript
  3. Router
  4. CSS Pre-processors
  5. Unit Testing

Build setup

  1. Class Style Syntax: Yes
  2. Use Babel alongside TypeScript: Yes
  3. Use history mode: No
  4. CSS Pre-processor: Sass/Scss dart-sass

Code

The debug point is set on console.log("started")

<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import HelloWorld from './components/HelloWorld.vue';

console.log("started")

@Component({
  components: {
    HelloWorld,
},
})
export default class App extends Vue {}
</script>

<style lang="scss">
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

WebStorm Debugger Settings:

https://i.sstatic.net/TLdCQ.png

Despite clicking the debug button, it is not stopping at the break point as expected.

package.json, tsconfig.json, and other files are all set to their default configurations.

Answer №1

To begin your application, initiate the npm serve run configuration first (not debugging). Afterward, select the JavaScript debug configuration and hit Debug.

For more information, refer to https://example.com/debugging-vue-js, specifically the Debugging the app section.

Answer №2

If your code isn't pausing at the breakpoint, it typically indicates that the execution flow is not reaching that specific point in your program or you may simply be inspecting the wrong section. When working on frontend projects, accessing your console can be done through your browser's developer tools by pressing F12. Additionally, utilizing the Vue Devtools extension is highly recommended for enhanced debugging capabilities.

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

The declaration file could not be located even after the .d.ts file was successfully generated

I encountered an issue while working with TypeScript src/usecases/Reports/GenerateReportUseCase.ts(7,23): error TS7016: Could not find a declaration file for module 'convert-json-to-csv'. This package lacks typings, which results in an error wh ...

Having trouble getting the Angular2 [innerHtml] directive to render properly?

Is there a way to inject HTML code from one Angular component into another using Angular 2 tags? @Component({ selector: 'app-root', template: '<app-a [my-html]="my-html"> </app-a>', styleUrls: ['./app.component.c ...

Guide on crafting a query with typeorm query builder to extract specific data from the database

I'm a beginner with typeorm in nodejs/nestjs and I'm struggling to create a query to filter course data by instructor's firstname and lastname, course name, and subject. I've tried using 'where' and 'orWhere' but can ...

Implementing reCaptcha on React Native: A Step-by-Step Guide

Currently, I am in the process of integrating a reCaptcha validator into a login screen for a react-native application that needs to function seamlessly on both web and mobile platforms. Despite being relatively new to programming and lacking experience w ...

Working with both vue 2 and vue 3 simultaneously on a single machine

Starting my first vue 3 project and running into issues with installing vue-cli. The documentation mentions that for Vue 3, I should be using Vue CLI v4.5 which can be found on npm as @vue/cli. To upgrade, it is necessary to reinstall the latest version of ...

Utilize Element UI autocomplete to transfer data into a VueJS-powered table's input fields

I am currently working on designing an invoice form using the Element UI framework. I have successfully integrated an autocomplete feature that retrieves data from the loadAll array. Upon clicking the add button and selecting an item_name from the autocomp ...

Transferring files and folders to the Electron Distribution directory

In short: I'm looking for a way to automate the process of copying files/directories from my src folder to dist/resources when packaging using Electron-packager. This need arose because I have JSON files in folders that need to be transferred to a sp ...

a guide to transforming data into a string with json using angular

I am struggling to figure out how to bind my form data into a JSON string. My situation involves using a string field in the database and saving checkbox values in a single database column using JSON. I have created an HTML form, but I am unsure of how to ...

The NuxtLink feature in Nuxt3 doesn't automatically refresh the layout CSS when the route changes

The functionality described in the code snippet below is quite straightforward. When a user visits the /blog route, the layout is switched to the blog layout which has a different header style. Similarly, the homepage has its own unique header style. Howev ...

Error message: Node package 'Typescript' could not be found

I've been working on setting up a project using Node and TypeScript. Unfortunately, I can't seem to figure out what's causing my settings to not work properly. I've tried different options for tsconfig/nodemon but nothing seems to be c ...

Retrieve the file from the input field

I have a requirement to retrieve an xls file and convert its content into json format. Currently, I am able to achieve this by specifying the file path directly in my code like below: var url = "D:/ionic/Docs/Test.xlsx"; However, I now need to allow ...

What is the syntax for creating ES6 arrow functions in TypeScript?

Without a doubt, TypeScript is the way to go for JavaScript projects. Its advantages are numerous, but one of the standout features is typed variables. Arrow functions, like the one below, are also fantastic: const arFunc = ({ n, m }) => console.log(`$ ...

Steps for connecting to a property in another component

As a newcomer to Angular, I am exploring new concepts for the first time. I have a custom component called Timeselector with an Apply button whose enable/disable state is determined by validations performed in another custom component called Monthpicker. C ...

How can I restrict a generic type to include the new() method?

Is there a way to create a function similar to the following in TypeScript? createEntity<TEntity>(): TEntity { return new TEntity(); } In C#, we can achieve this using: void TEntity CreateEntity<TEntity>() where TEntity : new() How would ...

Encountering a Typescript TypeError in es2022 that is not present in es2021

I'm attempting to switch the target property in the tsconfig.json file from es2015 to es2022, but I am encountering an error while running tests that seem to only use tsc without babel: Chrome Headless 110.0.5481.177 (Mac OS 10.15.7) TypeError: Can ...

Transform an array of FirebaseListObservables into an array of strings

UPDATED FOR MORE DETAIL: Imagine I have a collection of Survey objects and SurveyTaker objects in Firebase, with a relationship set up as follows: +-- surveyTakersBySurvey | +-- survey1 | | | +-- surveyTaker1 = true | +-- survey2 ...

Is it possible to eliminate the use of the `this` keyword in a Vue.js application?

I am currently following the guidelines of Douglas Crockford's jslint, which gives a warning when 'this' is used. The warning displayed is: [jslint] Unexpected 'this'. (unexpected_a) I have not been able to find a solution for th ...

How to Generate a JPG File from a Leaflet Map in Angular 4 using Typescript

I am developing a custom application using Angular4 that involves integrating leaflet maps. One of the requirements is to export the current view of a map as a JPG image, capturing only the map with markers and polylines - similar to taking a screenshot. ...

Accessing global variables from within a function in Typescript

How can I successfully return a value from a function in TypeScript? When using pdf.create().tofile() function, it always returns undefined. Even when I try to make the variable global and explicitly return it, I run into issues with TypeScript. Can someon ...

Vue js for filtering and replacing prohibited words

For this scenario, our objective is to screen the words in our input: <input type="text" class="form-control" placeholder="Write something..." v-model="todoInput""> Below are the restricted words that we aim to substitute in the input "restrict ...