skip to Main Content

All,

Have a naive looking problem: I have an application (react/viteJS) compiled in node16 and we run the app on https using mkcert on local machines. The app runs just fine. Now comes the udpate part. We udpated our app to nodeJS version 20 (and corresponding packages) and we keep getting this

This site can’t be reached admin.localhost.com refused to connect.

In the host files, we have the below

127.0.0.1       portal.localhost.com
127.0.0.1       admin.localhost.com

Again, this all works when switched to nodeJS 16.

2

Answers


  1. Chosen as BEST ANSWER

    Turns out the issue was with the vite.js configuration. For some reason, it specifically needed host to be set to "localhost.com" and surprisingly worked with with node16!


  2. Node v20 prefers ipv6 over ipv4 addresses. You can try adding the ipv6 address into you hosts file:

    ::1       portal.localhost.com
    ::1       admin.localhost.com
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search