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

Module build failed: Error: Didn't get a result from child compiler #131

Closed
vasivas opened this issue May 6, 2018 · 8 comments
Closed

Comments

@vasivas
Copy link

vasivas commented May 6, 2018

ERROR in ./app/routes/hello-route/hello.style.css
Module build failed: Error: Didn't get a result from child compiler
at childCompiler.runAsChild (/home/ivan/projects/react-ssr-template/node_modules/mini-css-extract-plugin/dist/loader.js:127:23)
at compile (/home/ivan/projects/react-ssr-template/node_modules/webpack/lib/Compiler.js:242:11)
at hooks.afterCompile.callAsync.err (/home/ivan/projects/react-ssr-template/node_modules/webpack/lib/Compiler.js:487:14)
at _err1 (eval at create (/home/ivan/projects/react-ssr-template/node_modules/tapable/lib/HookCodeFactory.js:24:12), :29:1)
at /home/ivan/projects/react-ssr-template/node_modules/awesome-typescript-loader/src/instance.ts:448:4
at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/ivan/projects/react-ssr-template/node_modules/tapable/lib/HookCodeFactory.js:24:12), :16:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/home/ivan/projects/react-ssr-template/node_modules/tapable/lib/Hook.js:35:21)
at compilation.seal.err (/home/ivan/projects/react-ssr-template/node_modules/webpack/lib/Compiler.js:484:30)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/ivan/projects/react-ssr-template/node_modules/tapable/lib/HookCodeFactory.js:24:12), :6:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/home/ivan/projects/react-ssr-template/node_modules/tapable/lib/Hook.js:35:21)
@ ./app/routes/hello-route/hello-route.ts 1:0-34 1:0-34
@ ./app/routes/hello-route/HelloRouteLoadable.tsx
@ ./app/App.tsx
@ ./client/client.tsx
@ multi webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=false&quiet=false&noInfo=false react-hot-loader/patch ./client/client.tsx

const path = require('path');

const webpack = require('webpack');

const {
    HotModuleReplacementPlugin,
    NoEmitOnErrorsPlugin,

    DefinePlugin,
    DllReferencePlugin
} = webpack;

const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const ReactLoadablePlugin = require('@7rulnik/react-loadable/webpack').ReactLoadablePlugin;



module.exports = {
    name: 'client',
    mode: 'development',
    target: 'web',
    context: path.resolve(__dirname,'src'),
    entry: [
            'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=false&quiet=false&noInfo=false',
            'react-hot-loader/patch',
            path.join(__dirname, 'src','client','client.tsx')
        ],
    output: {
        publicPath: "/static/",
        path: path.join(__dirname,'dest'),
        filename: 'client.js',
        chunkFilename:"[name].js",
        libraryTarget: "umd2",
        globalObject: "this"
    },
    resolve: {
        extensions: [".ts", ".tsx", ".js", ".css", ".json"],
        modules: ["node_modules"],
        alias: {
            'react-loadable':'@7rulnik/react-loadable',
            '@7rulnik/react-loadable':'@7rulnik/react-loadable',

            /** routes */

            'hello-route':path.join(__dirname,'src','app','routes','hello-route','hello-route.ts'),
            'world-route':path.join(__dirname,'src','app','routes','world-route','world-route.ts'),

            /** ------ */

        }
    },
    externals: {
    },
    devtool: 'cheap-inline-module-source-map',
    node:{
        fs:'empty'
    },
    module:{
        noParse:/\.json$/,
        rules:[
            {
                test: /(\.ts|\.tsx)$/,
                use: [
                    {
                        loader:'awesome-typescript-loader',
                        options: {
                            configFileName:path.join(__dirname,'tsconfig.dev.ssr.client.json')
                        }
                    }
                ],
                include: [path.join(__dirname,'src')],
                exclude: [/node_modules/, /\*\.spec.(ts|tsx)$/]
            },
            {
                test: /\.css$/,
                use: [
                    MiniCssExtractPlugin.loader,
                    // {loader: 'style-loader', options: {sourceMap: true}},
                    {loader: 'css-loader', options: {sourceMap: true}},
                ]
            },
            {
                test: /\.json$/,
                use: 'json-loader',
                exclude:[/node_modules/]
            },
        ]
    },
    plugins: [
        new HotModuleReplacementPlugin({
            multiStep:true
        }),
        new NoEmitOnErrorsPlugin(),

        new DllReferencePlugin({
            context: path.join(__dirname, 'dest'),
            manifest: require('./dest/root.dll.manifest.json'),
            sourceType: 'umd2',
        }),
        new DefinePlugin({
            'process.env': {
                NODE_ENV: JSON.stringify('development')
            }
        }),

        new MiniCssExtractPlugin({
            filename: "[name].css",
            chunkFilename: "[id].css"
        }),
        new ReactLoadablePlugin({
            filename:path.join(__dirname,'dest','loadable.manifest.json')
        }),
    ]
};

@alexander-akait
Copy link
Member

Duplicate #126, please provide minimum reproducible test repo

@vasivas
Copy link
Author

vasivas commented May 7, 2018

@dtothefp
Copy link

If HotModuleReplacementPlugin as option multiStep: true this happens. Even without it HMR doesn't work for me 😢

@divyam5-30
Copy link

Error: Didn't get a result from child compiler .
Im using Nextjs version 9.0.2
webpack 4.32.1

@divyam5-30
Copy link

const withSass = require("@zeit/next-sass");
const nextConfig = require("./config");

const withCSS = require('@zeit/next-css')

module.exports = withCSS(withSass(
{
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: "[local]___[hash:base64:5]",
},
webpack (config, options) {
config.module.rules.push({
test: /.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: {
loader: 'url-loader',
options: {
limit: 100000
}
}
});

return {...nextConfig(config)};

}
}));

this is my next.config.js file

@isggwp
Copy link

isggwp commented Sep 28, 2020

yeah i have the same issue

i use next 9.5 and antd latest

@jsking216
Copy link

yeah i have the same issue

i use next 9.5 and antd latest

Were you able to solve this? Having the same problem with a next 9.5 app.

@isggwp
Copy link

isggwp commented Oct 2, 2020

yeah i have the same issue
i use next 9.5 and antd latest

Were you able to solve this? Having the same problem with a next 9.5 app.

i am sory for late response.
i solve this with both import withCSS and withLESS

module.exports = withBundleAnalyzer( withCSS( withLess({}) ))

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

6 participants