You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the connect-assets css() method in dev mode, the following "Invalid mapping" error is thrown when using node-sass 4.x.
Reverting to node-sass 3.x works ok.
connect-assets can serve the css and map files directly. node-sass can generate the css and map files from the sources.
It's possibly a node-sass or source-map issue, just raising here in case.
{ Error: /sass-issue/app/views/index.pug:7
5| meta(name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no")
6|
> 7| != css("bootstrap")
8| != js("jquery")
9| != js("bootstrap")
10|
Invalid mapping: {"generated":{"line":1432,"column":28},"source":"bootstrap-sass/bootstrap/_type.scss","original":{"line":286,"column":-1},"name":null}
at SourceMapGenerator_validateMapping [as _validateMapping] (/sass-issue/node_modules/source-map/lib/source-map-generator.js:277:13)
at SourceMapGenerator_addMapping [as addMapping] (/sass-issue/node_modules/source-map/lib/source-map-generator.js:101:12)
at /sass-issue/node_modules/source-map/lib/source-node.js:345:13
at SourceNode_walk [as walk] (/sass-issue/node_modules/source-map/lib/source-node.js:224:9)
at SourceNode_walk [as walk] (/sass-issue/node_modules/source-map/lib/source-node.js:220:13)
at SourceNode_walk [as walk] (/sass-issue/node_modules/source-map/lib/source-node.js:220:13)
at SourceNode_toStringWithSourceMap [as toStringWithSourceMap] (/sass-issue/node_modules/source-map/lib/source-node.js:336:8)
at new BundledAsset (/sass-issue/node_modules/mincer/lib/mincer/assets/bundled.js:94:31)
at Index.Base.buildAsset (/sass-issue/node_modules/mincer/lib/mincer/base.js:535:12)
at /sass-issue/node_modules/mincer/lib/mincer/index.js:141:26
at Index.module.exports.cacheAsset (/sass-issue/node_modules/mincer/lib/mincer/helpers/caching.js:52:12)
at Index.buildAsset (/sass-issue/node_modules/mincer/lib/mincer/index.js:140:33)
at Index.Base.findAsset (/sass-issue/node_modules/mincer/lib/mincer/base.js:348:15)
at Index.findAsset (/sass-issue/node_modules/mincer/lib/mincer/index.js:114:22)
at Environment.findAsset (/sass-issue/node_modules/mincer/lib/mincer/environment.js:137:21)
at Assets.getAssetByPath (/sass-issue/node_modules/connect-assets/lib/assets.js:230:29)
at /sass-issue/node_modules/connect-assets/lib/assets.js:180:22
at eval (eval at wrap (/sass-issue/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:14:46)
at template (eval at wrap (/sass-issue/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:24:98)
at Object.exports.renderFile (/sass-issue/node_modules/pug/lib/index.js:410:38)
at Object.exports.renderFile (/sass-issue/node_modules/pug/lib/index.js:400:21)
at View.exports.__express [as engine] (/sass-issue/node_modules/pug/lib/index.js:447:11)
at View.render (/sass-issue/node_modules/express/lib/view.js:126:8)
at tryRender (/sass-issue/node_modules/express/lib/application.js:639:10)
at EventEmitter.render (/sass-issue/node_modules/express/lib/application.js:591:3)
at ServerResponse.render (/sass-issue/node_modules/express/lib/response.js:960:7)
at app.get (/sass-issue/app/index.js:10:32)
at Layer.handle [as handle_request] (/sass-issue/node_modules/express/lib/router/layer.js:95:5)
at next (/sass-issue/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/sass-issue/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/sass-issue/node_modules/express/lib/router/layer.js:95:5)
at /sass-issue/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/sass-issue/node_modules/express/lib/router/index.js:330:12)
at next (/sass-issue/node_modules/express/lib/router/index.js:271:10)
at middleware (/sass-issue/node_modules/connect-assets/index.js:46:7)
at Layer.handle [as handle_request] (/sass-issue/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/sass-issue/node_modules/express/lib/router/index.js:312:13)
at /sass-issue/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/sass-issue/node_modules/express/lib/router/index.js:330:12)
at next (/sass-issue/node_modules/express/lib/router/index.js:271:10)
at expressInit (/sass-issue/node_modules/express/lib/middleware/init.js:33:5)
at Layer.handle [as handle_request] (/sass-issue/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/sass-issue/node_modules/express/lib/router/index.js:312:13)
at /sass-issue/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/sass-issue/node_modules/express/lib/router/index.js:330:12)
at next (/sass-issue/node_modules/express/lib/router/index.js:271:10)
at query (/sass-issue/node_modules/express/lib/middleware/query.js:44:5)
at Layer.handle [as handle_request] (/sass-issue/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/sass-issue/node_modules/express/lib/router/index.js:312:13)
at /sass-issue/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/sass-issue/node_modules/express/lib/router/index.js:330:12)
at next (/sass-issue/node_modules/express/lib/router/index.js:271:10)
at Function.handle (/sass-issue/node_modules/express/lib/router/index.js:176:3)
at EventEmitter.handle (/sass-issue/node_modules/express/lib/application.js:173:10)
at Server.app (/sass-issue/node_modules/express/lib/express.js:38:9)
at emitTwo (events.js:106:13)
at Server.emit (events.js:191:7)
at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:546:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
The node-sass binary can generate the css and map files fine
$ cd app/assets/css/
$ ../../../node_modules/.bin/node-sass -o . --source-map true bootstrap.sass
Rendering Complete, saving .css file...
Wrote CSS to /sass-issue/app/assets/css/bootstrap.css
Wrote Source Map to /sass-issue/app/assets/css/bootstrap.css.map
The text was updated successfully, but these errors were encountered:
Initially raised over here: js-kyle/connect-assets#350
When using the connect-assets
css()
method in dev mode, the following "Invalid mapping" error is thrown when using node-sass 4.x.Reverting to node-sass 3.x works ok.
connect-assets can serve the css and map files directly.
node-sass
can generate the css and map files from the sources.It's possibly a node-sass or source-map issue, just raising here in case.
Demo app that reproduces the error is here: http://github.com/deployable/sass-issue (probably needs node6+)
connect-assets can serve the .css and .css.map files ok from the web app
The
node-sass
binary can generate the css and map files fineThe text was updated successfully, but these errors were encountered: