Skip to content

Dev Branch: "AxiosError: Unsupported protocol undefined:" #13

@anoduck

Description

@anoduck

Checked out dev branch which has the most recent fixes, had to modify the package.json to allow use of development server on remote machine. Fired it up, and received this message regarding Axios, which looks like a typescript issue.

The modification to package.json was adding -p $PORT -H $HOST to next dev in the dev script. So, line 13 in package.json looks like this:

"dev": "next dev -p 1234 -H 10.1.2.3"

A little researched suggested this has to do with the loginUrl variable not including the http:// part. So, I attempted to add it like so.

const loginUrl = `http://${baseUrl}/api/login`;
console.log('Login URL:', loginUrl);

// Send authentication request to the API
const response = await axios.post(loginUrl, {
    email: username,
    password: password
}, {
    headers: {
        'Content-Type': 'application/json',
    },
    withCredentials: true  // This is crucial for handling cookies between domains
}); 

Unfortunately, this caused the invalid url error, so the modification was reverted.

Below is a screenshot of the error.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions