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

v3.2.0-rc.1 webpack babel errors with optional chaining operator #913

Closed
chrisnoden opened this issue Jan 29, 2021 · 2 comments
Closed

v3.2.0-rc.1 webpack babel errors with optional chaining operator #913

chrisnoden opened this issue Jan 29, 2021 · 2 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@chrisnoden
Copy link

3.2.0-rc.1 breaks previously hard-earned webpack config - the use of the optional chaining operator can cause problems with babel. Perhaps you should document how to get this into our webpack (and, ideally, Encore) configs? Took me a day to figure out how to resolve your previous usage and you've changed it again in 3.2.0-rc.1

error  in ./node_modules/primevue/datatable/datatable.esm.js

Module parse failed: Unexpected token (180:57)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|         shouldRenderCol(column) {
|             if (this.rowGroupMode && this.rowGroupMode === 'subheader') {
>                 return this.groupRowsBy !== column.props?.field;
|             }
| 

It is the change of filename to .esm.js that breaks webpack config.

In my webpack.config.js (for Encore) I had to modify the babel loader:

    .addLoader({
        test: /\.js$/,
        loader: 'babel-loader',
        options: {
            plugins: [require("@babel/plugin-proposal-optional-chaining")]
        },
        exclude: file => (
            /node_modules/.test(file) &&
                !/\.vue.js/.test(file) &&
                !/\.esm.js/.test(file)
        )
    })
@LaurenceHo
Copy link

I ran into the same problem... Try to add above config into vue cli but it doesn't work. :(

@redsuperbat
Copy link

Ran into the same problem

@cagataycivici cagataycivici self-assigned this Feb 2, 2021
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Feb 2, 2021
@cagataycivici cagataycivici added this to the 3.2.0 milestone Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

4 participants