Webpack module assembly error: SyntaxError: 'import' and 'export' can only be displayed with 'sourceType: module'

I am using a mixture of Webpack / Babel 6 / React / eslint. Based on the answers I saw, I have all the necessary dependencies. My eslint configuration contains the following:

"parserOptions": {
    "ecmaVersion": 6,
    "sourceType": "module",
    "ecmaFeatures": {
        "jsx": true,
        "experimentalObjectRestSpread": true,
        "modules": true
    }
}

I can not find a solution for this. Any ideas are welcome.

+4
source share

All Articles