The CSS sourcemap is wrong while using TypeScript
idiotWu opened this issue · 4 comments
idiotWu commented
Problem
When using the sveltejs/template-webpack with TypeScript enabled, the inline CSS source map goes wrong and source contents can't be loaded.
Steps to Reproduce
- clone the template:
git clone git@github.com:sveltejs/template-webpack.git - run
npm install - run
node scripts/setupTypeScript.js - run
npm installagain - run
npm run dev - open
http://localhost:8080/with Chrome - open the devtool and inspect the
<h1>element - click source link in the
Stylepanel:
- you can see an error message in the
Sourcestab:Could not load content for http://localhost:8080/src/App.svelte (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)
Possible Cause
I tried parsing the inline sourcemap inside <style> element, and it seems that sourcesContent property is missing:

benmccann commented
We just released a new version of svelte-loader that I believe fixes this
idiotWu commented
@benmccann no, after updating svelte-loader to 3.1.2, this issue is still happening.
idiotWu commented
lagunovsky commented
Workaround: enable emitCss

