-
Notifications
You must be signed in to change notification settings - Fork 68
Closed as not planned
Closed as not planned
Copy link
Description
用的react v19和rsbuild,windows 11,vscode,点击元素跳转不了。Inpector的onClickElement返回的codeInfo是undefined。感觉应该没有遗漏什么。onClickElement传回下图这个object
const root = createRoot(document.body);
root.render(
<React.StrictMode>
<Inspector
onInspectElement={({ codeInfo }) => {
console.log("inspect");
gotoVSCode(codeInfo);
}}
onClickElement={(codeInfo) => {
console.log("click", codeInfo);
}}
/>
{/* App */}
</React.StrictMode>,
);
rsbuild.config.mjs:
import { defineConfig } from "@rsbuild/core";
import { pluginLess } from "@rsbuild/plugin-less";
import { pluginReact } from "@rsbuild/plugin-react";
import { launchEditorMiddleware } from "@react-dev-inspector/middleware";
export default defineConfig({
plugins: [pluginReact(), pluginLess()],
jsx: {
jsxImportSource: "react",
},
tools: {
webpack: (config) => {
config.plugins.push(
new webpack.DefinePlugin({
"require('fs')": "undefined",
}),
);
},
},
dev: {
setupMiddlewares: [
(middlewares, _server) => {
middlewares.unshift(launchEditorMiddleware);
},
],
},
});
Metadata
Metadata
Assignees
Labels
No labels