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

Error: Final loader didn't return a Buffer or String #1

Open
fantasia949 opened this issue Jul 13, 2017 · 4 comments
Open

Error: Final loader didn't return a Buffer or String #1

fantasia949 opened this issue Jul 13, 2017 · 4 comments
Labels

Comments

@fantasia949
Copy link

When trying the loader with your given minimum config, I got this error:

./node_modules/decss/preact.js!./node_modules/css-loader?{"modules":true,"importLoaders":1,"localIdentName":"[local]-[hash:base64:5] "}!./src/routes/home/styles.css Module build failed: Error: Final loader didn't return a Buffer or String at runLoaders (D:\x\node_modules\webpack\lib\NormalModule.js:202:46) at D:\x\node_modules\loader-runner\lib\LoaderRunner.js:370:3 at iterateNormalLoaders (D:\x\node_modules\loader-runner\lib\LoaderRunner.js:211:10) at iterateNormalLoaders (D:\x\node_modules\loader-runner\lib\LoaderRunner.js:218:10) at D:\x\node_modules\loader-runner\lib\LoaderRunner.js:233:3 at runSyncOrAsync (D:\x\node_modules\loader-runner\lib\LoaderRunner.js:130:11) at iterateNormalLoaders (D:\x\node_modules\loader-runner\lib\LoaderRunner.js:229:2) at iterateNormalLoaders (D:\x\node_modules\loader-runner\lib\LoaderRunner.js:218:10) at D:\x\node_modules\loader-runner\lib\LoaderRunner.js:233:3 at context.callback (D:\x\node_modules\loader-runner\lib\LoaderRunner.js:111:13) at Object.<anonymous> (D:\x\node_modules\css-loader\lib\loader.js:129:3) at D:\x\node_modules\css-loader\lib\processCss.js:207:3 at <anonymous> @ ./src/routes/home/styles.css 4:14-129

Did I miss something?

@kossnocorp
Copy link
Member

It looks like a css-loader error 🤔, can you share the content of the CSS you're trying to load?

@fantasia949
Copy link
Author

It's just simple

.Button {
    color: blue;
}

.Button-disabled {
    opacity: .5;
}

.Button-color-green {
    color: green;
}

When I comment out 'decss/preact', webpack performs the task properly. Here is my config for css:

{
            test: /\.css$/,
            include: [path.resolve(__dirname, 'src')],
            use: [
                'style-loader',
                //'decss/preact', // 👈 the error occurs when I uncomment this loader
                {
                    loader: 'css-loader',
                    options: {
                        modules: true,
                        importLoaders: 1,
                        localIdentName: '[local]-[hash:base64:5]',
                    }
                },
            ]
}

@kossnocorp
Copy link
Member

@fantasia949 what's the version of decss, webpack and css-loader you have installed? I suspect that it's version-specific problem.

@kossnocorp kossnocorp added the Bug label Jul 17, 2017
@fantasia949
Copy link
Author

fantasia949 commented Jul 17, 2017

{
    "style-loader": "^0.18.2",
    "webpack": "^3.2.0",
    "css-loader": "^0.28.4",
    "decss-loader": "^0.1.0",
}

I use Nodejs 8.1.2 + Windows for my development environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants