vitejs / vite-plugin-react-swc

Speed up your Vite dev server with SWC
MIT License
823 stars 52 forks source link

Unbound breakpoints while debugging React + TS + SWC inside VSCode #13

Closed Moshyfawn closed 1 year ago

Moshyfawn commented 1 year ago

Description

Using VSCode debugger, when setting a breakpoint and running the debugger, the breakpoint is unbound and the app execution doesn't break

image

Environment

Dependencies

{
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@types/node": "^18.11.12",
    "@types/react": "^18.0.26",
    "@types/react-dom": "^18.0.9",
    "@vitejs/plugin-react-swc": "^3.0.0",
    "typescript": "^4.9.3",
    "vite": "^4.0.0"
  }
}

Vite config

import { defineConfig } from "vite"
import react from "@vitejs/plugin-react-swc"

export default defineConfig({
  plugins: [react()]
})
ArnaudBarre commented 1 year ago

Thanks for the report, I will look at it

Moshyfawn commented 1 year ago

Thanks for the report, I will look at it

Appreciate it! Let me know if you need any more info; I'm not sure what can be useful for this issue

ArnaudBarre commented 1 year ago

I'm not using VSCoode, but here is the config I used to try to reproduce:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:5173",
            "webRoot": "${workspaceFolder}"
        }
    ]
}

I was able to set a breakpoint in the render of the component:

Screenshot 2022-12-10 at 13 25 37

What is your debug setup?

ArnaudBarre commented 1 year ago

Closing as can't reproduce. Feel free to reopen if you have more details on how to reproduce.