Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Vite version 6, breakpoints do not trigger correctly during build debugging. #19110

Closed
7 tasks done
newacorn opened this issue Dec 31, 2024 · 2 comments
Closed
7 tasks done

Comments

@newacorn
Copy link

Describe the bug

When upgrading from Vite 5 to Vite 6, the debug configuration file does not work as expected. It has always worked fine in Vite 5. This issue has been tested on both Visual Studio Code and JetBrains platforms, and while the problems manifest differently, neither works as expected.
The current debug screenshots are as follows (including JetBrains and Code):
Screenshot 2024-12-31 at 19 57 12
Screenshot 2024-12-31 at 19 57 56
The debug screenshots after simply changing the dependency version to Vite 5 are as follows:
Screenshot 2024-12-31 at 20 16 57
I'm not entirely sure if this is an issue with Vite. I've searched extensively but haven't been able to resolve it. I would greatly appreciate any hints or guidance here.

Reproduction

https://stackblitz.com/edit/bolt-vue-rzarxbse

Steps to reproduce

Use this simple package.json file, run npm install, and then debug the build script on the corresponding platform.

{
  "name": "vite-vue-typescript-starter",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vue-tsc -b && vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "vue": "^3.5.10"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^5.2.1",
    "typescript": "^5.5.3",
    "vite": "^6.0.0",
    "vue-tsc": "^2.2.0"
  }
}

System Info

Need to install the following packages:
[email protected]
Ok to proceed? (y) y


  System:
    OS: macOS 14.3
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900KS
    Memory: 125.88 MB / 64.00 GB
    Shell: 5.9 - /usr/local/bin/zsh
  Binaries:
    Node: 23.5.0 - /usr/local/bin/node
    npm: 10.9.2 - /usr/local/bin/npm
  Browsers:
    Safari: 17.3
    Safari Technology Preview: 18.0
  npmPackages:
    @vitejs/plugin-vue: ^5.2.1 => 5.2.1 
    vite: ^6.0.0 => 6.0.6

Used Package Manager

npm

Logs

No response

Validations

@hi-ogawa
Copy link
Collaborator

hi-ogawa commented Jan 2, 2025

I suspect this is because IDE ignores node_modules by default. After adding a following .vscode/settings.json, vscode debugger seems to pick up source map properly.

{
  "debug.javascript.terminalOptions": {
    "resolveSourceMapLocations": [
      "${workspaceFolder}/**",
      "!**/node_modules/**",
      "**/node_modules/.vite-temp/**"
    ]
  }
}

Some references

@newacorn
Copy link
Author

newacorn commented Jan 2, 2025

I suspect this is because IDE ignores node_modules by default. After adding a following .vscode/settings.json, vscode debugger seems to pick up source map properly.

{
  "debug.javascript.terminalOptions": {
    "resolveSourceMapLocations": [
      "${workspaceFolder}/**",
      "!**/node_modules/**",
      "**/node_modules/.vite-temp/**"
    ]
  }
}

Some references

Thank you very much! It works now.

@newacorn newacorn closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants