Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unfrozen object leaked before end of global code #32

Open
ghost opened this issue Oct 20, 2017 · 3 comments
Open

Unfrozen object leaked before end of global code #32

ghost opened this issue Oct 20, 2017 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Oct 20, 2017

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?

@gajus gajus added the question label Oct 21, 2017
@joshuaalpuerto
Copy link

Im also experiencing this issue, using React Boilerplate

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

@GeKorm
Copy link

GeKorm commented Nov 8, 2017

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

@axules
Copy link

axules commented Dec 9, 2017

npm i [email protected]
It helped me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants