I try to run my application based on webpack and during first run I got error.
Uncaught TypeError: Object(...) is not a function
at Object.<anonymous> (main.js:75)
at __webpack_require__ (main.js:20)
at Object.defineProperty.value (main.js:63)
at main.js:66
(anonymous) @ main.js:75
__webpack_require__ @ main.js:20
Object.defineProperty.value @ main.js:63
(anonymous) @ main.js:66
I understand the reason but can not understand how can I fix it. I found in networks a lot of similar questions and a lot of them `cause of sum plugins. I installed only one and could not find solution for him. Please help.
Thank you in advance.
commands what I run:
npm install --save-dev webpack
yarn add html-webpack-plugin -D
yarn run start
yarn add node-static -D
yarn run dev
my webpack.config.file:
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const PATHS = {
source: path.join(__dirname, 'src'),
build: path.join(__dirname, 'build')
};
module.exports = {
entry: PATHS.source + '/index.js',
output: {
path: PATHS.build,
filename: '[name].js'
},
plugins: [
new HtmlWebpackPlugin({
title: 'Webpack app'
})
]
}
;
package.json:
{
"name": "webpack-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack",
"dev": "static build"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"html-webpack-plugin": "^2.30.1",
"node-static": "^0.7.9",
"webpack": "^3.5.5"
}
}
I understand the reason but can not understand how can I fix it. I found in networks a lot of similar questions and a lot of them `cause of sum plugins. I installed only one and could not find solution for him. Please help.
Thank you in advance.