Hi, I just been refreshing my connecting Database to BackEnd to Frontend skills and followed this tutorial to the letter.
When I tried running it, I got…

Failed to compile

src\App.js  Line 0:  Parsing error: ImportDeclaration should appear when the mode is ES6 and in the module context

followed by another 5 similar errors. I tried running it from solution-code directory as well with same result? Is it something I’ve done wrong or you’ve done wrong? These tutorials are great but a lot of time and energy can be lost when there’s flaws in the code supplied. I had problems with the ‘restful restaurants’ API stuff too, where the solution-code almost worked… but not quite.

Thanks, Gavin.

I have exactly the same problem. Tell me please if you solved it.

Hi Andres,
I’ve been distracted of late by getting an actual web developer job… much sooner than expected! My Codecademy adventures have been put on hold a little while… Hope you or anyone else manages to fix it meanwhile.

Hey Gavin,

this error is produced by an outdated version of eslint. in the package.json file.

Just run npm audit fix --force in the view/ folder and it ll be fixed.

1 Like

Thanks. Good tip. I’ll try it once I’ve got to where I need to be with plain old HTML / CSS.

I solved the ImportDeclaration error by changing .eslintrc.json to use version 12 from latest. Here is the relevant section:

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

There were still a few additional issues to fix after this.