prepack-webpack-plugin
prepack-webpack-plugin copied to clipboard
Unfrozen object leaked before end of global code
Tried to run my Webpack production config and getting the following error since I added prepack-webpack-plugin
:
Error: PP0017: Unfrozen object leaked before end of global code at 2:1 to 2:6378
Error
at app.js:2:2
My Webpack config:
'use strict';
const path = require('path');
const webpack = require('webpack');
const PrepackWebpackPlugin = require('prepack-webpack-plugin').default;
const UglifyJsWebpackPLugin = require('uglifyjs-webpack-plugin');
const srcPath = path.resolve(__dirname, 'src');
const appPath = path.resolve(__dirname, 'app');
const webpackConfig = {
context: srcPath,
entry: {
app: path.resolve(srcPath, 'app.jsx'),
vendor: [
'react',
'react-dom',
'react-router-dom',
'glamor',
'glamorous',
'socket.io-client'
]
},
output: {
path: path.resolve(appPath, 'js'),
filename: 'app.js',
publicPath: '/'
},
resolve: {
extensions: ['.js', '.jsx'],
modules: [
path.resolve(__dirname, 'node_modules'),
path.resolve(srcPath, 'fonts'),
path.resolve(srcPath, 'helper'),
path.resolve(srcPath, 'screens'),
path.resolve(srcPath, 'components')
]
},
module: {
rules: [{
test: /\.jsx?$/,
use: 'babel-loader'
}, {
test: /\.(woff2?|jpg|jpeg|png|ico)$/,
use: {
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
}
}]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.js'
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
new UglifyJsWebpackPLugin(),
new PrepackWebpackPlugin()
]
};
module.exports = webpackConfig;
I'm on the latest version of prepack-webpack-plugin
, thought my app
was corrupt, but that isn't the case. I tested it with a basic setup of just importing React
, React-Dom
and then just rendering a basic Hello World!
.
Any ideas what could cause this?
Maybe this should be reported to facebook/prepack. Prepack 0.2.6 works for me, but the last few releases don't.
npm i [email protected]
It helped me