NUI callbacks return HTTP 403 when ui_page is an external URL
#128
Closed
etrex2k4
started this conversation in
[BUG] FiveM for GTAV Enhanced
Replies: 10 comments 3 replies
|
same on my sight |
0 replies
|
Yes, I've noticed that too - I can confirm it |
0 replies
|
same on my sight |
0 replies
|
same on my sight |
0 replies
|
same |
0 replies
|
I have exactly the same issue, but with |
2 replies
|
Same issue for my scrips as well. |
0 replies
|
Had the same issue but fixed it adding to the Solution is taken from #132 |
0 replies
|
Thanks for the report, I've been able to reproduce this. |
0 replies
|
A fix for this bug has been implemented and is available in the latest patch b95. Please try again and let us know if the issue persists. Thanks for your help! |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Environment: FiveM for GTAV Enhanced
CitizenFX/1.0.0.93, CEF Chrome/103.0.5060.134,FXServer Enhanced + txAdmin v9.0.0-beta, Windows 11, 2026-07-22.
What happens
A
fetch()from the NUI page tohttps://<resource>/<callback>returns 403 with anempty body whenever
ui_pagepoints to an external URL. Serving the exact same pagefrom the resource itself makes the exact same call return 200.
ui_pageindex.htmlhttps://cfx-nui-nui-origin-test{"ok":true}http://localhost:4200http://localhost:4200https://our-domain.examplehttps://our-domain.exampleHTTPS does not help, so this is not about secure contexts. Lua (
RegisterNUICallback) andJS (
RegisterNuiCallbackType+on('__cfx_nui:...')) behave identically. The same setupworks on Legacy.
Minimal repro
Why it hurts
Pointing
ui_pageat a dev server is the only way to get hot reload while building a NUI,and many servers ship their UI from their own domain in production. Both are dead on
Enhanced.
For context on the scale: our NUI is a large Angular 22 workspace (several applications
and shared libraries, hundreds of components). A production build takes over a minute, so
losing
ng servemeans every UI tweak turns into build + resource restart + reconnectinstead of a sub-second hot reload. Serving it from the resource also requires
--base-href /<subdir>/, otherwise the bundle URLs resolve against the resource root andthe page silently fails to load.
The failure is silent: the request succeeds at the network level, so frontend code that
only catches network errors sees nothing. The 403 has an empty body, so
response.json()throws
SyntaxError: Unexpected end of JSON input— that reads like a JSON bug, not apermission decision. In our case the UI rendered fine but never reached the client, the
player never spawned, and the server dropped us with
Timeout, because of no interaction.We spent hours suspecting natives and spawn code.
What would fix it for us
Any one of these:
sv_devMode.Issue type
Client
Repro rate
Always
Server build version
FXServer-early-access b92 win32
OS
No response
CPU
No response
GPU
No response
RAM
No response
Storage type
None
Connection type
None
ISP and bandwidth
No response
DxDiag
No response
Network graph
No response
Platform
None
OS version / distribution
No response
CPU
No response
RAM
No response
Using txAdmin?
None
Hosting provider
None
Machine type
None
/perf endpoint output
No response
DDoS protection
No response
ulimit -n value (Linux only)
No response
Docker Compose file (Docker only)
No response
Steps to Reproduce
frontend server on localhost:4200
Expected Behavior
ui should open and client should not freeze
Actual Behavior
client freeze an i got a disconnect
Evidence
No response
Additional Context
No response
All reactions