MERN - Error: Child compilation failed: Entry module not found: Error: Can't resolve 'html-loader'
I had stucking in this problem for a long time and not find out how to solve it. I just want to solve this issue and deploy it.
MERN - Error: Child compilation failed: Entry module not found: Error: Can't resolve 'html-loader'
Html Webpack Plugin:
Error: Child compilation failed:
Entry module not found: Error: Can't resolve 'html-loader' in 'C:UsersWachir awitDesktopKaewlomsupAnimalsCare':
Error: Can't resolve 'html-loader' in 'C:UsersWachirawitDesktopKaewlomsupA nimalsCare'
compiler.js:79 childCompiler.runAsChild
[KaewlomsupAnimalsCare]/[html-webpack-plugin]/lib/compiler.js:79:16Compiler.js:296 compile
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:296:11Compiler.js:552 hooks.afterCompile.callAsync.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:552:14Hook.js:154 AsyncSeriesHook.lazyCompileHook
[KaewlomsupAnimalsCare]/[tapable]/lib/Hook.js:154:20Compiler.js:549 compilation.seal.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:549:30Hook.js:154 AsyncSeriesHook.lazyCompileHook
[KaewlomsupAnimalsCare]/[tapable]/lib/Hook.js:154:20Compilation.js:1323 hooks.optimizeAssets.callAsync.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compilation.js:1323:35
webpack.config.js
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const outputDirectory = "dist";
module.exports = {
entry: ["babel-polyfill", "./src/client/index.js"],
output: {
path: path.resolve(__dirname, outputDirectory),
filename: "bundle.js"
},
module: {
rules: [
{
test: /.(js)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /.(css)$/,
use: ["style-loader", "css-loader"]
},
{
test: /.png|woff|woff2|eot|ttf|svg)$/,
loader: "url-loader?limit=100000"
},
{
test: /.(html)$/,
exclude: [/node_modules/,require.resolve("./src/client/index.js")],
use: {
loader: "html-loader"
}
}
]
},
devServer: {
port: 3000,
open: true,
proxy: {
"/api": "http://localhost:8080"
}
},
plugins: [
new CleanWebpackPlugin([outputDirectory]),
new HtmlWebpackPlugin({
template: "./public/index.html",
favicon: "./public/favicon.ico"
})
],
resolve: {
extensions: [".js", ".jsx"]
}
};
package.json
{
"name": "pth",
"version": "1.0.0",
"main": "src/server/index.js",
"scripts": {
"build": "webpack --mode production",
"start": "npm run build && node ./src/server/index.js",
"client": "webpack-dev-server --mode development --devtool inline-source-map --hot",
"server": "nodemon ./src/server/index.js",
"dev": "concurrently "yarn run server" "yarn run client""
},
"author": "BB",
"license": "ISC",
"dependencies": {
"@babel/runtime": "^7.1.5",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.3",
"express": "^4.16.4",
"express-jwt": "^5.3.1",
"express-messages": "^1.0.1",
"express-session": "^1.15.6",
"express-validator": "^5.3.0",
"jsonwebtoken": "^8.3.0",
"mongoose": "^5.3.8",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"prop-types": "^15.6.2",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"universal-cookie": "^3.0.4"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.0",
"babel-loader": "^8.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"clean-webpack-plugin": "^1.0.0",
"concurrently": "^4.0.0",
"css-loader": "^1.0.1",
"eslint": "^5.8.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"nodemon": "^1.18.5",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"webpack": "^4.5.0",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.10"
}
}
javascript node.js webpack deployment
add a comment |
I had stucking in this problem for a long time and not find out how to solve it. I just want to solve this issue and deploy it.
MERN - Error: Child compilation failed: Entry module not found: Error: Can't resolve 'html-loader'
Html Webpack Plugin:
Error: Child compilation failed:
Entry module not found: Error: Can't resolve 'html-loader' in 'C:UsersWachir awitDesktopKaewlomsupAnimalsCare':
Error: Can't resolve 'html-loader' in 'C:UsersWachirawitDesktopKaewlomsupA nimalsCare'
compiler.js:79 childCompiler.runAsChild
[KaewlomsupAnimalsCare]/[html-webpack-plugin]/lib/compiler.js:79:16Compiler.js:296 compile
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:296:11Compiler.js:552 hooks.afterCompile.callAsync.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:552:14Hook.js:154 AsyncSeriesHook.lazyCompileHook
[KaewlomsupAnimalsCare]/[tapable]/lib/Hook.js:154:20Compiler.js:549 compilation.seal.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:549:30Hook.js:154 AsyncSeriesHook.lazyCompileHook
[KaewlomsupAnimalsCare]/[tapable]/lib/Hook.js:154:20Compilation.js:1323 hooks.optimizeAssets.callAsync.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compilation.js:1323:35
webpack.config.js
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const outputDirectory = "dist";
module.exports = {
entry: ["babel-polyfill", "./src/client/index.js"],
output: {
path: path.resolve(__dirname, outputDirectory),
filename: "bundle.js"
},
module: {
rules: [
{
test: /.(js)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /.(css)$/,
use: ["style-loader", "css-loader"]
},
{
test: /.png|woff|woff2|eot|ttf|svg)$/,
loader: "url-loader?limit=100000"
},
{
test: /.(html)$/,
exclude: [/node_modules/,require.resolve("./src/client/index.js")],
use: {
loader: "html-loader"
}
}
]
},
devServer: {
port: 3000,
open: true,
proxy: {
"/api": "http://localhost:8080"
}
},
plugins: [
new CleanWebpackPlugin([outputDirectory]),
new HtmlWebpackPlugin({
template: "./public/index.html",
favicon: "./public/favicon.ico"
})
],
resolve: {
extensions: [".js", ".jsx"]
}
};
package.json
{
"name": "pth",
"version": "1.0.0",
"main": "src/server/index.js",
"scripts": {
"build": "webpack --mode production",
"start": "npm run build && node ./src/server/index.js",
"client": "webpack-dev-server --mode development --devtool inline-source-map --hot",
"server": "nodemon ./src/server/index.js",
"dev": "concurrently "yarn run server" "yarn run client""
},
"author": "BB",
"license": "ISC",
"dependencies": {
"@babel/runtime": "^7.1.5",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.3",
"express": "^4.16.4",
"express-jwt": "^5.3.1",
"express-messages": "^1.0.1",
"express-session": "^1.15.6",
"express-validator": "^5.3.0",
"jsonwebtoken": "^8.3.0",
"mongoose": "^5.3.8",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"prop-types": "^15.6.2",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"universal-cookie": "^3.0.4"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.0",
"babel-loader": "^8.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"clean-webpack-plugin": "^1.0.0",
"concurrently": "^4.0.0",
"css-loader": "^1.0.1",
"eslint": "^5.8.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"nodemon": "^1.18.5",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"webpack": "^4.5.0",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.10"
}
}
javascript node.js webpack deployment
add a comment |
I had stucking in this problem for a long time and not find out how to solve it. I just want to solve this issue and deploy it.
MERN - Error: Child compilation failed: Entry module not found: Error: Can't resolve 'html-loader'
Html Webpack Plugin:
Error: Child compilation failed:
Entry module not found: Error: Can't resolve 'html-loader' in 'C:UsersWachir awitDesktopKaewlomsupAnimalsCare':
Error: Can't resolve 'html-loader' in 'C:UsersWachirawitDesktopKaewlomsupA nimalsCare'
compiler.js:79 childCompiler.runAsChild
[KaewlomsupAnimalsCare]/[html-webpack-plugin]/lib/compiler.js:79:16Compiler.js:296 compile
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:296:11Compiler.js:552 hooks.afterCompile.callAsync.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:552:14Hook.js:154 AsyncSeriesHook.lazyCompileHook
[KaewlomsupAnimalsCare]/[tapable]/lib/Hook.js:154:20Compiler.js:549 compilation.seal.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:549:30Hook.js:154 AsyncSeriesHook.lazyCompileHook
[KaewlomsupAnimalsCare]/[tapable]/lib/Hook.js:154:20Compilation.js:1323 hooks.optimizeAssets.callAsync.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compilation.js:1323:35
webpack.config.js
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const outputDirectory = "dist";
module.exports = {
entry: ["babel-polyfill", "./src/client/index.js"],
output: {
path: path.resolve(__dirname, outputDirectory),
filename: "bundle.js"
},
module: {
rules: [
{
test: /.(js)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /.(css)$/,
use: ["style-loader", "css-loader"]
},
{
test: /.png|woff|woff2|eot|ttf|svg)$/,
loader: "url-loader?limit=100000"
},
{
test: /.(html)$/,
exclude: [/node_modules/,require.resolve("./src/client/index.js")],
use: {
loader: "html-loader"
}
}
]
},
devServer: {
port: 3000,
open: true,
proxy: {
"/api": "http://localhost:8080"
}
},
plugins: [
new CleanWebpackPlugin([outputDirectory]),
new HtmlWebpackPlugin({
template: "./public/index.html",
favicon: "./public/favicon.ico"
})
],
resolve: {
extensions: [".js", ".jsx"]
}
};
package.json
{
"name": "pth",
"version": "1.0.0",
"main": "src/server/index.js",
"scripts": {
"build": "webpack --mode production",
"start": "npm run build && node ./src/server/index.js",
"client": "webpack-dev-server --mode development --devtool inline-source-map --hot",
"server": "nodemon ./src/server/index.js",
"dev": "concurrently "yarn run server" "yarn run client""
},
"author": "BB",
"license": "ISC",
"dependencies": {
"@babel/runtime": "^7.1.5",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.3",
"express": "^4.16.4",
"express-jwt": "^5.3.1",
"express-messages": "^1.0.1",
"express-session": "^1.15.6",
"express-validator": "^5.3.0",
"jsonwebtoken": "^8.3.0",
"mongoose": "^5.3.8",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"prop-types": "^15.6.2",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"universal-cookie": "^3.0.4"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.0",
"babel-loader": "^8.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"clean-webpack-plugin": "^1.0.0",
"concurrently": "^4.0.0",
"css-loader": "^1.0.1",
"eslint": "^5.8.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"nodemon": "^1.18.5",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"webpack": "^4.5.0",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.10"
}
}
javascript node.js webpack deployment
I had stucking in this problem for a long time and not find out how to solve it. I just want to solve this issue and deploy it.
MERN - Error: Child compilation failed: Entry module not found: Error: Can't resolve 'html-loader'
Html Webpack Plugin:
Error: Child compilation failed:
Entry module not found: Error: Can't resolve 'html-loader' in 'C:UsersWachir awitDesktopKaewlomsupAnimalsCare':
Error: Can't resolve 'html-loader' in 'C:UsersWachirawitDesktopKaewlomsupA nimalsCare'
compiler.js:79 childCompiler.runAsChild
[KaewlomsupAnimalsCare]/[html-webpack-plugin]/lib/compiler.js:79:16Compiler.js:296 compile
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:296:11Compiler.js:552 hooks.afterCompile.callAsync.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:552:14Hook.js:154 AsyncSeriesHook.lazyCompileHook
[KaewlomsupAnimalsCare]/[tapable]/lib/Hook.js:154:20Compiler.js:549 compilation.seal.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compiler.js:549:30Hook.js:154 AsyncSeriesHook.lazyCompileHook
[KaewlomsupAnimalsCare]/[tapable]/lib/Hook.js:154:20Compilation.js:1323 hooks.optimizeAssets.callAsync.err
[KaewlomsupAnimalsCare]/[webpack]/lib/Compilation.js:1323:35
webpack.config.js
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const outputDirectory = "dist";
module.exports = {
entry: ["babel-polyfill", "./src/client/index.js"],
output: {
path: path.resolve(__dirname, outputDirectory),
filename: "bundle.js"
},
module: {
rules: [
{
test: /.(js)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /.(css)$/,
use: ["style-loader", "css-loader"]
},
{
test: /.png|woff|woff2|eot|ttf|svg)$/,
loader: "url-loader?limit=100000"
},
{
test: /.(html)$/,
exclude: [/node_modules/,require.resolve("./src/client/index.js")],
use: {
loader: "html-loader"
}
}
]
},
devServer: {
port: 3000,
open: true,
proxy: {
"/api": "http://localhost:8080"
}
},
plugins: [
new CleanWebpackPlugin([outputDirectory]),
new HtmlWebpackPlugin({
template: "./public/index.html",
favicon: "./public/favicon.ico"
})
],
resolve: {
extensions: [".js", ".jsx"]
}
};
package.json
{
"name": "pth",
"version": "1.0.0",
"main": "src/server/index.js",
"scripts": {
"build": "webpack --mode production",
"start": "npm run build && node ./src/server/index.js",
"client": "webpack-dev-server --mode development --devtool inline-source-map --hot",
"server": "nodemon ./src/server/index.js",
"dev": "concurrently "yarn run server" "yarn run client""
},
"author": "BB",
"license": "ISC",
"dependencies": {
"@babel/runtime": "^7.1.5",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.3",
"express": "^4.16.4",
"express-jwt": "^5.3.1",
"express-messages": "^1.0.1",
"express-session": "^1.15.6",
"express-validator": "^5.3.0",
"jsonwebtoken": "^8.3.0",
"mongoose": "^5.3.8",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"prop-types": "^15.6.2",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"universal-cookie": "^3.0.4"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.0",
"babel-loader": "^8.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"clean-webpack-plugin": "^1.0.0",
"concurrently": "^4.0.0",
"css-loader": "^1.0.1",
"eslint": "^5.8.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"nodemon": "^1.18.5",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"webpack": "^4.5.0",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.10"
}
}
javascript node.js webpack deployment
javascript node.js webpack deployment
asked Nov 22 '18 at 4:41
Wachirawit KaewlomsupWachirawit Kaewlomsup
12
12
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53424005%2fmern-error-child-compilation-failed-entry-module-not-found-error-cant-res%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53424005%2fmern-error-child-compilation-failed-entry-module-not-found-error-cant-res%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown