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

The CSS sourcemap is wrong while using TypeScript #187

Open
idiotWu opened this issue Jun 14, 2021 · 4 comments
Open

The CSS sourcemap is wrong while using TypeScript #187

idiotWu opened this issue Jun 14, 2021 · 4 comments

Comments

@idiotWu
Copy link

idiotWu commented Jun 14, 2021

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

  1. clone the template: git clone git@github.com:sveltejs/template-webpack.git
  2. run npm install
  3. run node scripts/setupTypeScript.js
  4. run npm install again
  5. run npm run dev
  6. open http://localhost:8080/ with Chrome
  7. open the devtool and inspect the <h1> element
  8. click source link in the Style panel:

  1. you can see an error message in the Sources tab: 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
Copy link
Member

We just released a new version of svelte-loader that I believe fixes this

@idiotWu
Copy link
Author

idiotWu commented Jun 15, 2021

@benmccann no, after updating svelte-loader to 3.1.2, this issue is still happening.

@idiotWu
Copy link
Author

idiotWu commented Jun 15, 2021

Source maps work by commenting out the following line, which is added in #172

if (processed.map) compileOptions.sourcemap = processed.map;

@benmccann benmccann transferred this issue from sveltejs/template-webpack Jun 15, 2021
@benmccann benmccann reopened this Jun 15, 2021
@lagunovsky

This comment has been minimized.

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

3 participants