prepack-webpack-plugin icon indicating copy to clipboard operation
prepack-webpack-plugin copied to clipboard

Unfrozen object leaked before end of global code

Open ghost opened this issue 7 years ago • 3 comments

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?

ghost avatar Oct 20 '17 23:10 ghost

Im also experiencing this issue, using React Boilerplate

screen shot 2017-10-30 at 1 47 14 pm

joshuaalpuerto avatar Oct 30 '17 05:10 joshuaalpuerto

Maybe this should be reported to facebook/prepack. Prepack 0.2.6 works for me, but the last few releases don't.

GeKorm avatar Nov 08 '17 09:11 GeKorm

npm i [email protected] It helped me

axules avatar Dec 09 '17 11:12 axules