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

Debugging source maps issue and possible fix #180

Closed
madisc opened this issue May 3, 2021 · 0 comments · Fixed by #183
Closed

Debugging source maps issue and possible fix #180

madisc opened this issue May 3, 2021 · 0 comments · Fixed by #183

Comments

@madisc
Copy link

madisc commented May 3, 2021

I'm using vscode to debug, and previously used rollup which worked. When I changed to webpack the svelte breakpoints weren't hit when using Svelte Preprocess (without was fine). I found adding this line makes it work:

if (!js.map.sourcesContent) {
    js.map.sourcesContent = [source];
  + js.map.sources = [compileOptions.filename] // ADD THIS
};

This may be a hacky solution, and I haven't tested it thoroughly, but Svelte breakpoints are now being hit. Hope this helps if anyone has been having similar issues.

Libs:

svelte 3.37.0
svelte-preprocess 4.7.2
svelte-loader 3.1.1
webpack 5.36.1

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

Successfully merging a pull request may close this issue.

1 participant