Next.js Discord

Discord Forum

Test if still connected to dev server

Unanswered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
I have a bit of a goofy bug right now. Basically, I have a script that automatically adds some data to a TypeScript file, which causes the app to hot-reload. However, if I pause the dev server, it will be disconnected and not update.

Is there any way to test if I'm still connected to the dev server, and reload if I'm not? (Obviously, I only need this during dev.)

3 Replies

@Sun bear "I have a script that automatically adds some data to a TypeScript file" Why do you need this?
American black bearOP
it’s used for storing an api interface
the user of the framework can design an interface, and the front end will automatically update to reflect the changes