When setting up my new Vue app, I followed these steps:
? Please pick a preset: Manually select features
? Check the features needed for your project: Choose Vue version, Babel, TS, PWA, Router, Vuex, CSS Pre-processors, Linter, Unit, E2E
? Choose a version of Vue.js that you want to start the project with 3.x (Preview)
? Use class-style component syntax? Yes
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? Yes
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with dart-sass)
? Pick a linter / formatter config: Prettier
? Pick additional lint features: Lint on save, Lint and fix on commit
? Pick a unit testing solution: Jest
? Pick an E2E testing solution: WebdriverIO
? Pick browsers to run end-to-end test on Chrome
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? No
After that, I added a launch.json to my VS Code setup following these configurations:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "vuejs: chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}/src",
"breakOnLoad": true,
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
}
}
]
}
Furthermore, I created a vue.config.js file in the root of my project with the following content:
module.exports = {
configureWebpack: {
devtool: 'source-map'
}
}
To troubleshoot an issue, I added a breakpoint in main.ts at the following code snippet:
createApp(App)
.use(store)
.use(router)
.mount("#app");
Upon running npm run serve
from the command line and hitting F5 in VS Code, I encountered no breakpoint. How can I go about troubleshooting this? Could it be that Typescript is incompatible with Vue in this scenario, even though I've successfully used JS in previous projects?