Running Next.js development server in a Coder instance... is there a best practice?

Having trouble with the path - by default Next is looking at the root of the domain for it's built files (scripts, etc). Has anyone solved this?
8 Replies
Codercord
Codercord3w ago
<#1301554545939189842>
Category
Other
Product
code-server
Platform
Linux
Logs
Please post any relevant logs/error messages.
Phorcys
Phorcys3w ago
you should be able to change the root path to be relative your next.js configuration
Erik Johnson
Erik JohnsonOP3w ago
Next configuration offers something called basePath but I haven't figured out what is going to work (or if it'll work) - is there an example I could see?
Phorcys
Phorcys3w ago
what would work is the URL you're accessing the port through so something like /proxy/<port> (I forgot what it is) but then the issue is that the base path will depend on the port which isn't great I would recommend looking into using Coder OSS as that supports port-forwarding using a wildcard domain (e.g <port>.coder.example.com), so it will be at the root of the domain and you won't have issues like this sadly path-based proxying really isn't that great and doesn't play well with some apps, I've looked around next.js's GH issues and it seems that you can't just use a relative path like some apps let you do (@Erik Johnson)
Erik Johnson
Erik JohnsonOP3w ago
Thanks @Phorcys I'll look into OSS, because I'm also afraid it'll get a bit wonky...
Phorcys
Phorcys3w ago
I understand, but yeah with code-server i'm afraid there isn't really a way around it can I close this issue?
Erik Johnson
Erik JohnsonOP3w ago
Sure.
Codercord
Codercord3w ago
@Phorcys closed the thread.
Want results from more Discord servers?
Add your server