I deleted a React component that was never used, but now the page won't render... huh?

I had a component in a ReactJS app I am working on that I sweeeearrr is not used anywhere. It even gave me the warning that "footer is defined but not used'. It isn't render anywhere and it never did anything, modify state... yet I'm getting an error message that says that the page cannot be rendered because the file is missing after I deleted it.

Is this simply a matter that I must be missing a connection somewhere?

2 answers

  • answered 2017-11-14 23:26 stealththeninja

    A few troubleshooting tips. It's helpful if you include these details in your question so we know what you've already tried. Try one at a time and see if the error resolves:

    1. Restart your server (webpack-dev?).
    2. Clear browser cache or open an incognito window and load the page again.
    3. String-search your project for the file name.

  • answered 2017-11-14 23:46 basarat

    yet I'm getting an error message that says that the page cannot be rendered because the file is missing after I deleted it.

    An unused import / require statement is left in there.

    Solution

    Search for filename in the entire code base and remove usage.

    More

    Something like TypeScript would have caught this at compile time.