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

Webpack invalid mapping #720

Closed
leefernandes opened this issue May 25, 2017 · 2 comments
Closed

Webpack invalid mapping #720

leefernandes opened this issue May 25, 2017 · 2 comments

Comments

@leefernandes
Copy link

leefernandes commented May 25, 2017

node_modules/source-map/lib/source-map-generator.js:277
Error: Invalid mapping: {"generated":{"line":13415,"column":2},"source":"node_modules/@material/theme/_mixins.scss","original":{"line":94,"column":-1},"name":null}

When each of the below component stylesheets are imported by "app.scss" the compiler fails. Remove one of the imports, or remove line #94 of theme/_mixins.scss (&--theme-dark,) and it successfully compiles.

What MDC-Web Version are you using?

"material/button": "0.3.6",
"material/icon-toggle": "0.1.11",
"material/radio": "0.2.4",
"material/switch": "0.1.7",
"material/textfield": "0.2.9",

What are the steps to reproduce the bug?

@import "@material/button/mdc-button";
@import "@material/icon-toggle/mdc-icon-toggle";
@import "@material/radio/mdc-radio";
@import "@material/switch/mdc-switch";
@import "@material/textfield/mdc-textfield";
var webpack = require("webpack"),
    path = require("path"),
    ExtractTextPlugin = require("extract-text-webpack-plugin")

module.exports = {
    devtool: "source-map",
    entry: {
        "app.css": "app.scss",
    },
    output: {
        filename: "[name]",
        path: path.resolve(__dirname, "dist")
    },
    resolve: {
        modules: [
            path.resolve(__dirname, './'),
            path.resolve(__dirname, './node_modules'),
        ]
    },
    plugins: [
        new ExtractTextPlugin({
            filename: '[name]',
            publicPath: '/',
            allChunks: true
        })
    ],
    module: {
        rules: [{
            test: /\.scss$/,
            use: ExtractTextPlugin.extract({
                fallback: "style-loader",
                use: [{
                        loader: "css-loader",
                        options: {
                            sourceMap: true
                        }
                    },
                    {
                        loader: "sass-loader",
                        options: {
                            sourceMap: true,
                            outputStyle: "nested",
                            includePaths: [
                                path.resolve(__dirname, './node_modules')
                            ]
                        }
                    }
                ]
            })
        }]
    },
};

What is the expected behavior?

The stylesheets should compile when any combination of components are imported.

What is the actual behavior?

The compiler fails when the above five are imported.

@leefernandes
Copy link
Author

Potentially related: sass/libsass#2312

@leefernandes
Copy link
Author

Closing due to the issue being external: webpack-contrib/sass-loader#351

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

1 participant