Strapi custom plugin hot reload error

I am developing a custom screen for admin panel, that is called a plugin in Strapi.
I run the app using strapi develop --watch-admin
But whenever I save the file in my IDE, it hot reloads, but gives me an error saying
Warning: An error occured while requesting the API , and logs me out.

Attaching a screenshot for the same.

1 Like

Same here. For me it will usually redirect to login after 5-10 seconds. Or I have to manually refresh to get shown the login page again.

Running strapi v4.0.5 and v4.0.6.
Node 14.7.5
Tried with both yarn 1.22.1 and npm 7.21.0

Edit:
It also appears to be happening in an official strapi video tutorial, so I’m guessing they are aware of it:

@abhimanyuPatil Removing this line fixes hot reload for me. No idea what effect this has downstream, but at least reloading works without being bumped out to the login page.

2 Likes

thanks mate, I’ll try and see if that works

where do I find this file? I am on ubuntu 20.04

The file is located in node_modules/@strapi/strapi. Keep in mind that it will reset every time you update strapi.