ericclemmons / click-to-component

Option+Click React components in your browser to instantly open the source in VS Code
MIT License
1.83k stars 69 forks source link

Couldn't find a React instance for the element (Not using CRA) #62

Closed leonelmeque closed 9 months ago

leonelmeque commented 2 years ago

Describe the bug I have tried using the package with a custom webpack config on a monorepo, but I can't seem to get it to work. I tried in projects that I used CRA and the package works perfectly.

To Reproduce Steps to reproduce the behavior:

  1. Go to any component
  2. Click on option + click or option + right-click

Expected behavior Is to see my component in vscode

Additional context if someone wants to fork and help me fix the problem would be nice https://github.com/leonelmeque/todo-app-monorepo

Dustin-Digitar commented 1 year ago

Getting the same error when option+click. When using option+right click, then click on one of the links in the popup, that works fine.

LeonMueller-OneAndOnly commented 1 year ago

On following issue page you can find a solution for this problem. It is currently not implemented in the package, but can easily be added. The codebase is kept lightweight and easy to fork into a own react-component of yours.

https://github.com/ericclemmons/click-to-component/issues/34

Dustin-Digitar commented 1 year ago

This seems like a pretty common problem, considering it occurs when using MUI, which is the most popular UI library. The fix you link to seems like a small change, so it would be best to just add it to the "official" code base, instead of having people fork it.

spacecat commented 1 year ago

This seems like a pretty common problem, considering it occurs when using MUI, which is the most popular UI library. The fix you link to seems like a small change, so it would be best to just add it to the "official" code base, instead of having people fork it.

I got this error today and I don't use MUI. And yes, it's best to fix this bug upstream.

LeonMueller-OneAndOnly commented 9 months ago

This issue was fixed and the changes are merged to main now.

See following pull-request: https://github.com/ericclemmons/click-to-component/pull/79