Including the ssh2-promise library breaks api route causing 404
Unanswered
Ovenbird posted this in #help-forum
OvenbirdOP
I've created an api route that has a GET and POST request associated with it. The api route works fine until I create a new instance of the ssh2-promise client class. As soon as I do this, reloading the page throws a NextJS 404 error. When I comment out the line again, everything works fine.
There isn't an error at all in my console, nextjs just stops loading the file for some reason 🤷♂️
There isn't an error at all in my console, nextjs just stops loading the file for some reason 🤷♂️
3 Replies
OvenbirdOP
bump. If more info is needed, let me know 🤞
OvenbirdOP
looks like switching to an alternate library (node-ssh) fixed the issue. I have no idea why using ssh2-promise just completely breaks next its api functionality. Not sure if I mark this as resolved? It's only really fixed by using an alternate library