HoudiniGraphql / houdini

The disappearing GraphQL framework
http://www.houdinigraphql.com
MIT License
908 stars 97 forks source link

Source maps are broken when using houdini plugin #1154

Open pdaddyo opened 1 year ago

pdaddyo commented 1 year ago

Describe the bug

Apparently due to the source transformation that happens in the houdini plugin.

Source maps being broken is affecting our ability to trap errors with Sentry etc - v difficult to debug our large app at all now.

This issue was discussed on discord here but adding to github to see if community can help address.

Thanks!

Severity

serious, but I can work around it

Steps to Reproduce the Bug

To reproduce in the HoudiniGraphQL/example-sveltekit-todo repo, I've added a single debugger statement to the top of handleClick() in lib/ItemEntry.svelte, when triggered the Chrome debugger has the line significantly wrong. Manual breakpoints set in Chrome / vscode also don't line up due to the incorrect source map. image

Reproduction

No response

AlecAivazis commented 1 year ago

Ah damn, sorry to hear that! Getting the sourcemaps wired up correctly has been a long running thorn in my side. Do you have any time/energy to hunt this down? If so I'd gladly offer any guidance you need

pdaddyo commented 1 year ago

Unfortunately I'm v time poor at the moment but happy to at least see how hard it would be and help if I can. As you say Recast should be handling it but (from previous discussion) looks like there's string interpolation e.g. here. I also noted that this affects .ts files as well as .svelte files so it's likely not the only issue... thorny indeed :)

shadow-identity commented 1 year ago

Is it a reason that trace backs are also broken? When it points to unrelated pieces of code, not to actual issue source.

tomcharwood commented 1 year ago

This is causing so many issues for us too - would be great to solve!

knd775 commented 1 year ago

Ah damn, sorry to hear that! Getting the sourcemaps wired up correctly has been a long running thorn in my side. Do you have any time/energy to hunt this down? If so I'd gladly offer any guidance you need

Do you have any idea what's causing this? I'd like to at least attempt to track this down, but it'd be great to have a starting point.

AlecAivazis commented 1 year ago

For anyone running into this thread - I reached out to knd on discord where the back and forth is a bit easier 😅

gschulze commented 11 months ago

Ran into the same issue, making Unit tests effectively non-debuggable. Would be great to have this resolved soon.

SeppahBaws commented 5 months ago

I put together a minimal reproduction, if anyone wants to attempt to hunt this down :) https://stackblitz.com/edit/sveltejs-kit-template-default-abiwnx?file=src%2Flib%2FTestComponent.svelte

Simply open the devtools and hit the "fetch data" button. I also found this tool to visualize the sourcemaps, could be useful for debugging this: https://evanw.github.io/source-map-visualization/