Answer the question
In order to leave comments, you need to log in
Webpack gives "fatal error in line 0" when building, what should I do?
Hello, I ran into such a problem (I have Linux light OS on Ubuntu):
Webpack when building, for example, with such a command... webpack-dev-server --mode development --open
...gives this picture...
> [email protected] start /home/egor/Documents/Start.iqFin.ru
> webpack-dev-server --mode development --open
ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/egor/Documents/Start.iqFin.ru/dist
ℹ 「wdm」: wait until bundle finished: /
#
# Fatal error in , line 0
# Check failed: U_SUCCESS(status).
#
#
#
#FailureMessage Object: 0x7ffc2bf92540Illegal instruction (core dumped)
npm ERR! code ELIFECYCLE
npm ERR! errno 132
npm ERR! [email protected] start: `webpack-dev-server --mode development --open`
npm ERR! Exit status 132
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/egor/.npm/_logs/2019-04-28T10_25_55_292Z-debug.log
{
"name": "start.iqfin_app",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"build": "webpack --mode production",
"dev": "webpack --mode development",
"dev:watch": "webpack --mode development --watch",
"start": "webpack-dev-server --mode development --open"
},
"author": "Wolland",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"babel-loader": "^8.0.5",
"css-loader": "^2.1.1",
"html-webpack-plugin": "^4.0.0-beta.5",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.12.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"pug": "^2.0.3",
"pug-loader": "^2.4.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"uglifyjs-webpack-plugin": "^2.1.2",
"webpack": "^4.30.0",
"webpack-cli": "^3.3.1",
"webpack-dev-server": "^3.3.1"
},
"dependencies": {
"@babel/polyfill": "^7.2.5",
"axios": "^0.18.0",
"pug": "^2.0.3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/HogwartsProgrammers/Start.iqFin.ru.git"
},
"bugs": {
"url": "https://github.com/HogwartsProgrammers/Start.iqFin.ru/issues"
},
"homepage": "https://github.com/HogwartsProgrammers/Start.iqFin.ru#readme",
"description": ""
}
const path = require('path') // Модуль NodeJS для работы с путями
const HTMLPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
entry: ['./src/index.js'],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
optimization: {
minimizer: [
new OptimizeCssAssetsPlugin({}),
new UglifyJsPlugin({})
]
},
devServer: {
contentBase: __dirname + '/dist',
port: '8080'
},
plugins: [
new HTMLPlugin({
filename: 'index.html',
// template: './src/index.html'
template: './src/index.pug'
}),
new MiniCssExtractPlugin({
filename: 'spectre.min.css'
})
],
resolve: {
extensions: ['.js']
},
module: {
rules: [
{ test: /\.pug$/, loader: 'pug-loader', options: { pretty: true } },
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] }
]
}
}
Answer the question
In order to leave comments, you need to log in
This is a bug in node.js version 12. Until they fix the situation, you can go back to the 10 LTS version. She won't have those problems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question