radix-ui / primitives

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
https://radix-ui.com/primitives
MIT License
15.65k stars 803 forks source link

Sourcemaps are off #1410

Open cdeutsch opened 2 years ago

cdeutsch commented 2 years ago

Bug report

Current Behavior

I'm trying to debug why Dropdown doesn't work in my project and I'm trying to step through Popper.tsx from the line:

const anchorRect = useRect(context.anchor);

When I get to observeElementRect in observeElementRect.ts the debugger is totally off and you can no longer step through the code.

image

I'm using eval-source-map as the devtool setting. Other libraries seem to be working.

Expected behavior

I expect the chrome dev tools to work.

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-dropdown-menu 0.1.6
React n/a 16.13.1
Browser Chrome 101.0.4951.64
Operating System Mac 12.2.1
benoitgrelard commented 2 years ago

Hey @cdeutsch,

What do you mean exactly by "the debugger is totally off" and "you can no longer step through the code"? Looking at your screenshot, I'm not sure I understand.

Thanks

cdeutsch commented 2 years ago

On line 19 in the screenshot, if I click "step over next line", the debugger jumps to line 31.

I was trying to verify on https://www.radix-ui.com/docs/primitives/components/dropdown-menu but it doesn't seem to have the source maps included.

It's possible this is just related to my webpack build, so can probably close unless someone else can verify.

benoitgrelard commented 2 years ago

Thanks, I will try and see if I can replicate your issue.