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

[Bug]: Some debugger breakpoints are not bound #3687

Closed
tonisives opened this issue Oct 12, 2024 · 3 comments
Closed

[Bug]: Some debugger breakpoints are not bound #3687

tonisives opened this issue Oct 12, 2024 · 3 comments
Labels
🐞 bug Something isn't working need reproduction

Comments

@tonisives
Copy link

tonisives commented Oct 12, 2024

Version

System:
OS: macOS 15.0
CPU: (12) arm64 Apple M3 Pro
Memory: 4.86 GB / 36.00 GB
Shell: 5.9 - /bin/zsh
Browsers:
Brave Browser: 129.1.70.126
Chrome: 125.0.6422.142
Safari: 18.0
npmPackages:
@rsbuild/core: ^1.0.13 => 1.0.13
@rsbuild/plugin-node-polyfill: ^1.0.4 => 1.0.4
@rsbuild/plugin-react: ^1.0.3 => 1.0.3

Details

As you can see from the picture, some lines are greyed out in the debugger. They cannot be bound. However, the first lines in the same function can be bound and debugging works.

Image

When I change the function code a little bit(remove cast), then the breakpoints work for the whole function

Image

My rsbuild config has sourceMap enabled:

import { defineConfig } from "@rsbuild/core"
import {} from "@rsbuild/core"
import { pluginReact } from "@rsbuild/plugin-react"
import { dependencies } from "./package.json"
import { pluginNodePolyfill } from "@rsbuild/plugin-node-polyfill"

let toSingleton = (dep: keyof typeof dependencies) => ({
  [dep]: {
    singleton: true,
    requiredVersion: dependencies[dep],
    eager: process.env.NODE_ENV === "development",
  },
})

export default defineConfig({
  plugins: [pluginReact(), pluginNodePolyfill()],
  tools: {
    rspack: {
      resolve: {},
    },
  },
  server: {
    port: 3002,
  },
  output: {
    minify: false,
    sourceMap: {
      js: "source-map",
    },
  },
  html: {
    template: "./index.html",
  },
  source: {
    entry: {
      index: "./src/main.tsx",
    },
  },
  moduleFederation: {
    options: {
      name: "checklist_view",
      filename: "remoteEntry.js",
      exposes: {
        "./Checklist": "./src/checklist/Checklist",
      },
      remotes: {
        finding_view: "finding_view@https://....net/remoteEntry.js",
        debug_view: "debug_view@http://localhost:3004/remoteEntry.js",
      },
      shared: {
        ...toSingleton("react"),
        ...toSingleton("react-dom"),
        ...toSingleton("react-simple-code-editor"),
      },
    },
  },
})

tsconfig.json

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ES2022",
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "moduleResolution": "Bundler",
    "resolveJsonModule": true,
    "sourceMap": true,
    "declaration": true,
    "declarationMap": true,
    "jsx": "react-jsx",
  },
}

Reproduce link

empty

Reproduce Steps

I run the app with rsbuild dev. Also tried with rsbuild build && rsbuild preview

@tonisives tonisives added the 🐞 bug Something isn't working label Oct 12, 2024
Copy link
Contributor

Hello @tonisives. Please provide a reproduction repository or online demo. For background, see Why reproductions are required. Thanks ❤️

@chenjiahan
Copy link
Member

Maybe related to SWC, the same as web-infra-dev/rspack#8108

Copy link
Contributor

As the issue was labelled with need reproduction, but no response in 5 days. This issue will be closed. Feel free to comment and reopen it if you have any further questions. For background, see Why reproductions are required.

由于该 issue 被标记为 "需要重现",但在 5 天内没有回应,因此该 issue 将被关闭。如果你有任何进一步的问题,请随时发表评论并重新打开该 issue。背景请参考 为什么需要最小重现

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working need reproduction
Projects
None yet
Development

No branches or pull requests

2 participants