Upon attempting to run `yarn dev` with Webpack 5, I encountered the following error message: "Library name must be a string or

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!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Choose the text value of the jQuery select menu from the specified column in the table

I need to search through all the select elements in a specific table column with the id "tdcities". I want to compare their ids with the row id and if there is a match, I need to select the text value. Below is the code I am currently using: $("#tdcities ...

Mapping drop-downs based on the length of a JSON array

Looking to generate dropdowns in a React Native mobile application based on the length of values in an API JSON array. Here's an example of the desired output: eg:- Choice 1 (Label of the Drop Down) -Sub Choice 1 . (Value Data) ...

The issue of Angular 6 view failing to display accurate data upon page load

In my Angular 6 application, I've implemented a login feature using Firebase's Google login. The interface includes a button labeled Login when the user is logged out, and changes to Logout with the current email address displayed when the user i ...

Use a for loop to iterate through elements and retrieve input values using getElementById()

As I work through a for loop in JavaScript, I am utilizing the getElementById() method to fetch multiple input values. To begin, I dynamically created various input boxes and assigned distinct id's using a for loop. Subsequently, I am employing anoth ...

Waiting for the function to finish in both the caller and the callee

One of the classes in my service is named: Test. Inside this Test Class, there is a method called: getMe(). Within the getMe function, I have 3 await statements where the 2nd one relies on the result from the first one, and the third one depends on the a ...

Strategies for managing multiple scripts on a single page web application

As someone who is new to Web development, I have started working on an application that consists of an index.php file with a menu and a div called #content. I am using load() to load different pages into the div #content. My challenge is that I also need t ...

`Zooming and scrolling feature within a masked image`

I'm struggling to achieve a scrolling zoom effect similar to the website mentioned below, but I can't seem to get it to fully zoom. Additionally, when I try to zoom in on a clipped shape or text while scrolling, the entire div ends up scrolling ...

Tips for programmatically setting an option as the chosen selection?

Here is the structure of my HTML code: <select class="form-control" name="settings.provider" id="settings.provider" ng-model="settings.provider" required> <option value="" disabled selected>Select Provider</option> &l ...

Utilizing Vue 3 to transform an item within a list by referencing its index

Storing the element's index in a global variable is causing issues when trying to individually edit each of them. Adding multiple elements with similar properties but being unable to edit them separately due to alterations affecting the rest is a chal ...

The issue of req.file being consistently undefined in Node.js multer

I am having issues trying to upload a file using multer because the req.file is always undefined and the destination folder remains empty: Server: var express = require('express'); var multer = require('multer') var app = express(); ...

"Encountered an error message: Unable to retrieve property 'getCapabilities' due to a TypeError

Everything was going smoothly with my tests until I encountered an issue when the browser.getCapabilities(); method was called in the OnComplete function, resulting in an error. //The HTMLReport is triggered once all tests are completed onComplete: f ...

Angular: Creating an input field with preset value that is immutable

I am a beginner with angular and I have been working on this code snippet: <mat-form-field appearance="outline" class="col-30" id="mat-identifier"> <mat-label> {{'columns.dashboard.identifier' | ...

In the console, a JSON string is displayed, however the PHP variable outputs as null

Below is the snippet of javascript code I am working with: $('.showEditForm').click(function () { var webpagefileID = this.id; if($('#editForm').css('display', 'none')) { $('#editForm').css ...

Changing the prefix for a guild can be done without needing a complete restart, while adding a new guild to my database inexplicably requires one

I have set up a code that adds guilds to the database with default settings when they join. If the guild decides to change the prefix, it updates successfully and they can immediately start using it. However, there is an issue where I have to restart the b ...

TypeScript integration with T4MVC

Within my ASP.NET MVC (5) project, I utilize T4MVC to avoid using magic strings in my views. While this approach works well, there are instances where I require URLs in my JavaScript or TypeScript code, particularly for AJAX requests. Currently, I rely o ...

React - Children components in an array not updating when props are modified within a callback function

The question may be a bit unclear, so let me provide further explanation. This is a personal project I am working on to improve my understanding of React basics and socket.io. Within this project, I have developed a CollapsibleList component and a NestedL ...

Angular Flot Chart Resizing: A Guide to Dynamic Chart S

I have successfully integrated a Flot chart into my HTML using an Angular directive. Here is how it looks: <flot id="placeholder" dataset="dataset" options="options" height="300px" width="100%" style="width:100%;" ng-disabled="graphLoading" ng-class="{ ...

Error message: "Root resolution error encountered". Need assistance in granting watchman access?

After setting up a react-native starter project, I was prompted to allow watchman access to my system's files. Unfortunately, I declined and now whenever I try to run the folder, I encounter the following error: Error: unable to resolve root /Users/ck ...

Why does Froala Editor not maintain formatting when retrieving data from the database?

I've been using the Froala editor to add content on my website, and it's doing well for inserting data into the database. However, I'm facing an issue when retrieving data from the database as it doesn't maintain the original formatting ...

Utilizing setInterval to navigate through a Google Sheets document

I have a Google spreadsheet with 4 rows, and I want to iterate through them one at a time every hour. The current code works but posts all four rows at the same time. How can I post one row every hour continuously? require('console-stamp')(conso ...