admin管理员组

文章数量:1307120

we are using webpack 4 and upgraded from babel 6 to 7, webpack succeeds and builds the output, but seeing below error when app is run,

Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

bablerc

 {
       "presets": [
           "@babel/react" ,
           "@babel/env"
       ],       
       "plugins": [
           "@babel/plugin-proposal-class-properties",
           [
                "@babel/plugin-transform-spread",
                    {
                        "loose": true
                    }
            ]
       ]
    }

webpack

 {
                test: /\.(js|jsx)$/,
                exclude: /(node_modules|bower_components)/,
                use: ['babel-loader', 'eslint-loader']
            },

have tried adding - "sourceType": "unambiguous" to babelrc as advised in - How do I fix 'Cannot assign to read only property 'exports' of object '#<Object>' when adding a 2nd function to module.exports?, it did not work. any help is appreciated.

本文标签: