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

[Error] Invalid left-hand side expression in prefix operation #242

Closed
DaveyJake opened this issue Sep 3, 2021 · 4 comments
Closed

[Error] Invalid left-hand side expression in prefix operation #242

DaveyJake opened this issue Sep 3, 2021 · 4 comments

Comments

@DaveyJake
Copy link

DaveyJake commented Sep 3, 2021

After two days of trying to debug this, I'm hoping someone here can help?

Initially, I thought it was due to still using Webpack 4 as other devDependencies are using Webpack 5. After running npm install webpack@latest --save-dev, I find I'm still getting this error.

Unsure of what to do, I adjusted my config to only handle the JS. All of the SCSS and images are handled separately and are working fine.

My current webpack.config.js is as follows:

import path from 'path';
import ESLintWebpackPlugin from 'eslint-webpack-plugin';

module.exports = {
    mode: 'development',
    devtool: 'source-map',
    target: 'web',
    context: path.resolve( __dirname, '.' ),
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /(^_*$|node_modules(?![\\\/]foundation-sites))/,
                use: ['babel-loader']
            }
        ]
    },
    plugins: [
        new ESLintWebpackPlugin({ eslintPath: path.resolve( __dirname, '.eslintrc.yml' ) })
    ],
    optimization: {
        emitOnErrors: true
    },
    resolve: {
        alias: {
            Helpers: path.resolve( __dirname, '/path/to/src/js/helpers/' ),
            Modules: path.resolve( __dirname, '/path/to/src/js/modules/' ),
            UI: path.resolve( __dirname, '/path/to/src/js/ui/' ),
            Vendor: path.resolve( __dirname, '/path/to/src/js/_vendor/' )
        }
    },
    entry: {
        app: path.resolve( __dirname, '/path/to/entry.js' )
    },
    output: {
        path: path.resolve( __dirname, '/path/to/dist/js' ),
        publicPath: `/wp-content/plugins/${ path.basename( __dirname ) }/dist/js/`,
        filename: '[name].min.js',
        devtoolNamespace: path.basename( __dirname )
    },
    externals: {
        jQuery: 'jQuery',
        lodash: {
            commonjs: 'lodash',
            amd: 'lodash',
            root: '_'
        },
        google: 'google',
        MarkerClusterer: 'MarkerClusterer',
    },
    stats: 'verbose'
}

Does anyone have any ideas of why I continue to get the Invalid left-hand side expression in prefix operation error? Any advice would be much appreciated.

@shama
Copy link
Owner

shama commented Sep 3, 2021

This is an issue board for reporting issues with webpack-stream. I recommend stackoverflow.com or webpack's support channels for more general help.

@shama shama closed this as completed Sep 3, 2021
@DaveyJake
Copy link
Author

DaveyJake commented Sep 3, 2021

This is an issue board for reporting issues with webpack-stream. I recommend stackoverflow.com or webpack's support channels for more general help.

My CLI says, Error in plugin "webpack-stream"

@DaveyJake
Copy link
Author

DaveyJake commented Sep 3, 2021

@shama

Screen Shot 2021-09-03 at 16 17 16

@shama
Copy link
Owner

shama commented Sep 3, 2021

You'll need to provide a lot more information about how this issue originates from this library webpack-stream. A stack trace is a good start.

I'm fairly certain the error is occurring from somewhere else while using this library though. Especially considering this library isn't a plugin and I'm not familiar with any of the code you provide above.

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

No branches or pull requests

2 participants