sveltejs/svelte-loader

Source maps seems to break after version 3.1.0

raythurnvoid opened this issue · 4 comments

3.1.0

image

3.0.0 rollback

image

You can check this behavior here: https://github.com/raythurnevoid/svelte-template/tree/svelte-loader-3.1.0
Source maps work for ts files but not for svelte.

Env;

  • webpack: ^5.31.2
  • webpack-dev-server: ^3.11.2
  • typescript: ^4.2.4
  • svelte: ^3.37.0
  • OS: Windows 10
  • Node: 14.16.1 (LTS)
non25 commented

This is where things started: #171

Currently I don't understand where issue should be fixed. In svelte core or in svelte-loader.

Here's PR for upstream: sveltejs/svelte#6089

We can fix this as proposed by @rtpt-jonaslieb, but I have no idea how this will impact future svelte versions.

@dummdidumm Thoughts?

Mhm the upstream PR should only take effect in situations when there's no script tag, but in this case one exists.

non25 commented

Can't make things inconvinient in Firefox, tried to throw an error from svelte component.
Jumped to bundled code in console, from there jumped to the original location - component source. Source is there. The line in question is highlighted.

@raythurnevoid Can you try this branch and report if that fixes things for you?

npm i -D non25/svelte-loader#fix-sources-content
# or in yarn
yarn add -D svelte-loader@non25/svelte-loader#fix-sources-content

@non25 Works like a charms!
image

You are amazing!