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

Server function sourcemap contains query parameters in the file name #375

Open
InvictusMB opened this issue Sep 19, 2024 · 0 comments
Open

Comments

@InvictusMB
Copy link

I was playing around with server functions in SolidStart and noticed that the debugger in WebStorm cannot properly map the code within 'use server' blocks.

Turns out the source filename in the generated sourcemap was file:\\\ ... \src\routes\page.tsx?pick=route. So the query parameter seems to mislead the debugger.

I don't see why sourcemaps would include query parameters but I'm not sure where is the right place to remove them. I tried hacking this directly into plugin-directives by using a stripped url instead of id here:

for (const transform of transforms) {
if (transform.transform) {
result = await transform.transform(result.code, id, {
...opts,
map: result.map,
});
}
}

It does work and WebStorm does pick up breakpoints properly but I guess there has to be a more appropriate place to strip query parameters from sourcemaps as more plugins might rely on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant