question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSS Sourcemap is always empty

See original GitHub issue

My Angular-Cli version is 1.0.0-beta.26 Here is my angular-cli.json:

{
  "project": {
    "version": "1.0.0-beta.26",
    "name": "test"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.json",
      "prefix": "app",
      "mobile": false,
      "styles": [
        "styles.scss"
      ],
      "scripts": [],
      "environments": {
        "source": "environments/environment.ts",
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "scss",
    "prefixInterfaces": false,
    "inline": {
      "style": false,
      "template": false
    },
    "spec": {
      "class": false,
      "component": true,
      "directive": true,
      "module": false,
      "pipe": true,
      "service": true
    }
  }
}

And Here is my styles.scss

h1 {
    font-size: 20px;
}

When I type ng serve --extract-css=true or ng build --extract-css=true, the styles.bundle.map is always empty like:

{"version":3,"sources":[],"names":[],"mappings":"","file":"styles.bundle.css","sourceRoot":""}

Does anyone have the same issue with me ? Or maybe this is expected behavior ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
changLiuUNSWcommented, Feb 21, 2017

Yes, it works. I forget to put --extract-css Thanks @filipesilva

1reaction
craigcosmocommented, Feb 15, 2017

Are you sure it’s fixed? I still have the issue. My command is like this

"start": "ng serve --port 1800 --extract-css=true --sourcemap=true",

And source map still not show up

screen_shot_2017-02-15_at_11_04_08_pm

demo: https://github.com/craigcosmo/yeahman-angular-cli-app

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack: understanding source maps when working with CSS
The problem with my current setup is that I would like to have proper source map support and that does not seem to...
Read more >
4 Reasons Why Your Source Maps are Broken - Sentry Blog
4 Reasons Why Your Source Maps are Broken · Missing or incorrect source map directive · Missing original source files · Bad source...
Read more >
PostCSS API
If you create a node manually (e.g., with postcss.decl() ), that node will not have a source property and will be absent from...
Read more >
CSS source map support, network performance analysis & more
If I attempt to perform cross origin ajax request, I always do this by mistake usually a typo, Chrome print a clear error...
Read more >
RequireJS Optimizer
Optimizes CSS by inlining CSS files referenced by @import and removing comments. ... You can always explicitly add modules that are not found...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found