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

Sass sourcemap issue #410

Closed
nojaf opened this issue Apr 6, 2017 · 7 comments
Closed

Sass sourcemap issue #410

nojaf opened this issue Apr 6, 2017 · 7 comments

Comments

@nojaf
Copy link

nojaf commented Apr 6, 2017

Node version:
v7.7.1
npm version:
4.1.2
Operating system:
Windows 10 Anniversary Update
Command line used:
babel-node tools/build.js
Steps to reproduce:

I'm using bootstrap-sass and I'm having an exception on the generation of the source maps.

C:\Users\Moi\live\node_modules\source-map\lib\source-map-generator.js:277
      throw new Error('Invalid mapping: ' + JSON.stringify({
      ^

Error: Invalid mapping: {"generated":{"line":1,"column":26388},"source":"webpack:///Users/Moi/live/src/styles/C:/Users/Moi/live/node_modules/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_clearfix.scss","original":{"line":15,"column":-11},"name":null}
    at SourceMapGenerator_validateMapping [as _validateMapping] (C:\Users\Moi\live\node_modules\source-map\lib\source-map-generator.js:277:13)
    at SourceMapGenerator_addMapping [as addMapping] (C:\Users\Moi\live\node_modules\source-map\lib\source-map-generator.js:101:12)
    at C:\Users\Moi\live\node_modules\source-map\lib\source-node.js:345:13
    at SourceNode_walk [as walk] (C:\Users\Moi\live\node_modules\source-map\lib\source-node.js:224:9)
    at SourceNode_walk [as walk] (C:\Users\Moi\live\node_modules\source-map\lib\source-node.js:220:13)
    at SourceNode_walk [as walk] (C:\Users\Moi\live\node_modules\source-map\lib\source-node.js:220:13)
    at SourceNode_toStringWithSourceMap [as toStringWithSourceMap] (C:\Users\Moi\live\node_modules\source-map\lib\source-node.js:336:8)
    at ConcatSource.proto.sourceAndMap (C:\Users\Moi\live\node_modules\webpack-sources\lib\SourceAndMapMixin.js:28:32)
    at Compilation.<anonymous> (C:\Users\Moi\live\node_modules\webpack\lib\SourceMapDevToolPlugin.js:57:32)
    at Array.map (native)
    at Compilation.<anonymous> (C:\Users\Moi\live\node_modules\webpack\lib\SourceMapDevToolPlugin.js:43:84)
    at Array.forEach (native)
    at Compilation.<anonymous> (C:\Users\Moi\live\node_modules\webpack\lib\SourceMapDevToolPlugin.js:42:11)
    at Compilation.applyPlugins1 (C:\Users\Moi\live\node_modules\tapable\lib\Tapable.js:75:14)
    at self.applyPluginsAsync.err (C:\Users\Moi\live\node_modules\webpack\lib\Compilation.js:630:11)
    at next (C:\Users\Moi\live\node_modules\tapable\lib\Tapable.js:138:11)

Is there a way to disable sourcemaps for css?

@kwelch
Copy link
Collaborator

kwelch commented Apr 7, 2017

I have not seen this before but the source maps are set in the loaders within the webpack config.

@nojaf
Copy link
Author

nojaf commented Apr 7, 2017

@kwelch can I disable them for now somehow?

@kwelch
Copy link
Collaborator

kwelch commented Apr 7, 2017

You can turn them off, by removing the sourcemap flag from this line in the webpack.config.

{test: /(\.css|\.scss|\.sass)$/, loaders: ['style-loader', 'css-loader?sourceMap', 'postcss-loader', 'sass-loader?sourceMap']}

It will have to be done for both dev and prod if the issue exists in both.

@nojaf
Copy link
Author

nojaf commented Apr 7, 2017

Thanks, I'll try this out tonight

@nickytonline
Copy link
Collaborator

@nojaf, just following up. Did @kwelch's suggestion work for you?

@nojaf
Copy link
Author

nojaf commented Apr 25, 2017

Yes it did.

@hvalcourtSerdy
Copy link

It appears this may be related to sass/libsass#2312

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

4 participants