[HELP] NUI callback fails with ERR_NAME_NOT_RESOLVED

Im trying to send a NUI callback but it fails every time. On inspecting further via DevTools I found out that NUI post message was not successful returning resource: net::ERR_NAME_NOT_RESOLVED
image
Im sure there is some silly mistake but Im not able to figure it out.

My LUA code:


	call = data.call
	task = data.returnTask 

	if call == "isVideoActive" and task == 'videoGotFucked' then
		print(task, "<-------------------------------------")
		print("--> Destroying DUI due to video API error")
		isDUIActive = false
		runLoop = false
		shouldDraw = false
		exports['mythic_notify']:DoHudText('error', "Unknown error occoured due to API ", { ['background-color'] = '#9C3E3E', ['color'] = '#FFFFFF' })
		SetDuiUrl("about:blank")
						
	end 
end)

My JS code:

function onPlayerError(event){
             console.log(event.data)
              console.log("Player Error occoured");
              $.post("http://ultra-cinema/returnCall", JSON.stringify({
                      call: "isVideoActive",
                      returnTask: "videoGotFucked"
                  }))
            }

The above onPlayerError is called automatically via yt iframe API

RegisterNUICallback('return_call', function(data, cb) 
    ... lua code here ....
end)

i remember some time ago there was an error with characters in the name of CB’s and resource names
try renaming the resource to ultra_cinema and callback to return_call

1 Like