Are you getting an error after the ionic serve command? Me too!

Today I tried the tutorial from Ionic with React on how to start a new Ionic Application and my terminal seems to be stuck at the following line:

                      react-hooks/exhaustive-deps
[react-scripts] ./src/pages/SchedulePage.tsx
[react-scripts] Line 9:25: 'addFavorite' is defined but never used @typescript-eslint/no-unused-vars
[react-scripts] Line 9:38: 'removeFavorite' is defined but never used @typescript-eslint/no-unused-vars
[react-scripts] Search for the keywords to learn more about each warning.
[react-scripts] To ignore, add // eslint-disable-next-line to the line before.

I waited and waited but the app will never load up.

What you can do to fix it?

Open the file with the trouble. In my case, it was ./src/pages/SchedulePage.tsx on line 9 I added the following line:

// eslint-disable-next-line

Save the file, and that should work.

NOTE: For my situation, I had to add the // eslint-disable-next-line to each of the following files to make it work:

  • ./src/pages/SchedulePage.tsx
    • Line 9
  • ./src/components/SessionListItem.tsx
    • Line 1
    • Line 3
  • ./src/data/connect.tsx
    • Line 39
    • Line 44

After I added the comments to each of these files, I was able to get the server running and I got the sweet victory message!

[INFO] Development server running!
[INFO] Development server running! Local: http://localhost:8100 Use Ctrl+C to quit this process [INFO] Browser window opened to http://localhost:8100!

NOTE: I ran the same command for Angular and it worked perfectly without any issues. The lesson here is that Ionic with React is new, I suspect these issues will be resolve with development.

Thank you.