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

Child compilation failed #25

Open
he5050 opened this issue Dec 10, 2018 · 6 comments
Open

Child compilation failed #25

he5050 opened this issue Dec 10, 2018 · 6 comments
Labels
has answer question Further information is requested

Comments

@he5050
Copy link

he5050 commented Dec 10, 2018

entry: [
    "webpack-hot-middleware/client?reload=true&path=/__webpack_hmr", 
    "@babel/polyfill",
    "./src/index.js", 
    "./dll/vendor.dll.js"
  ],

new HtmlWebpackPlugin({
      filename: "index.html",
      favicon: "./public/favicon.png",
      template: `!!prerender-loader?string!${path.resolve(__dirname, "public", "index.ejs")}`, 
      inject: true,
      templateParameters: {
        dll: "<script src='/vendor.dll.js'></script>",
        manifest: ""
      }
    }),

Error Info


    ERROR in ./public/index.ejs (./node_modules/prerender-loader/dist/prerender-loader.js?string!./public/index.ejs)
    Module build failed (from ./node_modules/prerender-loader/dist/prerender-loader.js):
    Error: Child compilation failed:
    resolve './webpack-hot-middleware\client?reload=true&path=\__webpack_hmr' in 'E:\h-project\txz-web-admin-car-manger'
      using description file: E:\h-project\txz-web-admin-car-manger\package.json (relative path: .)
        Field 'browser' doesn't contain a valid alias configuration
        using description file: E:\h-project\txz-web-admin-car-manger\package.json (relative path: ./webpack-hot-middleware/client)
          no extension
            Field 'browser' doesn't contain a valid alias configuration
@chiboreache
Copy link

+1

ERROR in   Error: Child compilation failed:
  Module build failed: Error: Child compilation failed:

  - prerender-loader.js:23
    [prerender]/[prerender-loader]/dist/prerender-loader.js:23:31

  - Compiler.js:510 applyPluginsAsync.err
    [prerender]/[webpack]/lib/Compiler.js:510:14

  - Tapable.js:202 next
    [prerender]/[tapable]/lib/Tapable.js:202:11
...

I just added template: '!!prerender-loader?string!index.html', into my webpack.prod.conf.js

@kradalby
Copy link

kradalby commented Feb 3, 2019

I have a similar in my build environment, but not on my laptop. When ran in a node:10 container it fails, but not on my Mac.

@chiboreache

This comment has been minimized.

@kradalby
Copy link

kradalby commented Feb 3, 2019

Scratch it, my issue was vuejs/vue-cli#3407 (comment)

Which was a underlying dependency, sorry about that.

@developit
Copy link
Collaborator

When using multiple webpack entries, you must tell prerender-loader which to include:

entry: [
    "webpack-hot-middleware/client?reload=true&path=/__webpack_hmr", 
    "@babel/polyfill",
    "./src/index.js",    // <-- there is no way to know that this is the correct entry
    "./dll/vendor.dll.js"
  ],

new HtmlWebpackPlugin({
      filename: "index.html",
      favicon: "./public/favicon.png",
-     template: `!!prerender-loader?string!${path.resolve(__dirname, "public", "index.ejs")}`, 
+     template: `!!prerender-loader?string&entry=./src/index.js!${path.resolve(__dirname, "public", "index.ejs")}`, 
      //  so we specifically pass it here ^^^^^^^^^^^^^^^^^^^^^
      inject: true,
      templateParameters: {
        dll: "<script src='/vendor.dll.js'></script>",
        manifest: ""
      }
    }),

@firebluetom2
Copy link

firebluetom2 commented May 12, 2020

With multiple entry points I get this error:
Conflict: Multiple chunks emit assets to the same filename ssr-bundle.js (chunks other and example)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has answer question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants