Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NUI Fetch ERR_NAMED Error #3094

Closed
Xenknight61 opened this issue Jan 24, 2025 · 1 comment
Closed

NUI Fetch ERR_NAMED Error #3094

Xenknight61 opened this issue Jan 24, 2025 · 1 comment
Labels

Comments

@Xenknight61
Copy link

What happened?

When I perform the operation in NUI in the first image, I get the error "net::ERR_NAME_NOT_RESOLVED" as seen in.
The reason for the error is the "_" at the beginning of the username.
Everything works normally as seen in the second and third pictures.

Image

Image

Image

Expected result

The expected result is that the fetch operation works.

Reproduction steps

  1. A server using a user account preceded by "_"
  2. A ping using SetHttpHandler native
SetHttpHandler(function(request, response)
  if request.method == 'GET' and request.path == '/ping' then -- if a GET request was sent to the `/ping` path
      response.writeHead(200, { ['Content-Type'] = 'text/plain' }) -- set the response status code to `200 OK` and the body content type to plain text
      response.send('pong') -- respond to the request with `pong`
  else -- otherwise
      response.writeHead(404) -- set the response status code to `404 Not Found`
      response.send() -- respond to the request with no data
  end
end)
local WebURL = GetConvar("web_baseUrl", "") .."/resourcename/ping"
  1. When you use WebURL in NUI fetch, you will get the error "net::ERR_NAME_NOT_RESOLVED"
const requestOptions = {
  method: "POST",
  redirect: "follow"
};

fetch("WebURL", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));

Importancy

Unknown

Area(s)

FiveM

Specific version(s)

Server 12508

Additional information

No response

@Xenknight61 Xenknight61 added bug triage Needs a preliminary assessment to determine the urgency and required action labels Jan 24, 2025
@tens0rfl0w
Copy link
Contributor

Duplicate of #2329

@github-actions github-actions bot removed the triage Needs a preliminary assessment to determine the urgency and required action label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants