Parsing error: ImportDeclaration should appear when the mode is ES6 and in the module context

Reporting a bug in the module “How to structure your apps MVC Architecture for Full-Stack App”. The error is in the title. Appears to be a problem with the babel eslint package but cant quite figure out how to fix it. Tried running npm audit fix --force which didnt work and tried updating the eslint and babel-eslint packages as well which didnt work. Ran the solution code to confirm the error was not in my code and receive same error.
Please respond with a fix, thank you!



Do you have a link to the lesson?

I’ll move this over to the Bug Reporting category.

Yes, I can confirm that this bug is still present in the starting (and solution) code. I solved it by changing .eslintrc.json to use ecmaVersion 12 instead of latest. May have to do with how the create-react-app/ESLint linting has been configured:

    "parserOptions": {
        "ecmaFeatures": {
            "jsx": true
        "ecmaVersion": 12,
        "sourceType": "module"
1 Like

Here’s the form to report bugs:

Finally, it looks like the problem is fixed.

After npm install the view… I run the audit fix --force and it works!

Likely, it has to do with deprecated packages

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.