Seeking assistance from my fellow developers. Has anyone encountered this particular issue before?
Error output displayed in text:
yarn run v1.17.3
$ webpack-dev-server webpack --config ./webpack.dev.config.js --mode development
i 「wds」: Project is running at http://localhost:9000/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from E:\demo\webpack-demo
i 「wdm」: wait until bundle finished: /
× 「wdm」: Error: Library name must be a string or string array
at AssignLibraryPlugin.parseOptions (E:\demo\webpack-demo\node_modules\webpack\lib\library\AssignLibraryPlugin.js:110:11)
at AssignLibraryPlugin._parseOptionsCached (E:\demo\webpack-demo\node_modules\webpack\lib\library\AbstractLibraryPlugin.js:120:23)
at compilation.hooks.finishModules.tap (E:\demo\webpack-demo\node_modules\webpack\lib\library\AbstractLibraryPlugin.js:60:27)
at Hook.eval [as callAsync] (eval at create (E:\demo\webpack-demo\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:18:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (E:\demo\webpack-demo\node_modules\webpack\node_modules\tapable\lib\Hook.js:18:14)
at Compilation.finish (E:\demo\webpack-demo\node_modules\webpack\lib\Compilation.js:1695:28)
at process.nextTick (E:\demo\webpack-demo\node_modules\webpack\lib\Compiler.js:976:19)
at process._tickCallback (internal/process/next_tick.js:61:11)
i 「wdm」: wait until bundle finished: /
i 「wdm」: wait until bundle finished: /
i 「wdm」: wait until bundle finished: /
Here's the content of my package.json file:
{
"name": "exercise",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack-dev-server webpack --config ./webpack.dev.config.js --mode development"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"babel-loader": "^8.1.0",
"core-decorators": "^0.20.0",
"html-webpack-plugin": "^4.3.0",
"webpack": "^5.1.3",
"webpack-dev-server": "^3.11.0"
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"fs": "^0.0.1-security",
"module": "^1.2.5",
"webpack-cli": "3.3.12",
"webpack-node-externals": "^2.5.2"
}
}
This represents my configuration:
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
const nodeExternals = require("webpack-node-externals");
module.exports = {
entry: './src/index.js',
target: 'web',
mode: "production",
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
libraryTarget: "var"
},
externals: [nodeExternals()],
// externals: {
// "child_process": "require('child_process')",
// "fs": "require('fs')",
// "path": "require('path')"
// },
module: {
rules: [{
test: /\.js?$/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}]
},
plugins: [
new HtmlWebpackPlugin({
template: './index.html'
})
],
devServer: {
open: true,
port: 9000
}
}
New to StackOverflow and desperately seeking assistance--thanks in advance for your help!