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

Uncaught (in promise) TypeError: Failed to fetch #106

Open
Nanorithm opened this issue Mar 9, 2024 · 2 comments
Open

Uncaught (in promise) TypeError: Failed to fetch #106

Nanorithm opened this issue Mar 9, 2024 · 2 comments

Comments

@Nanorithm
Copy link

Describe the bug
It seems that I get a console error when ever I click an action within the menu. Sometimes it is one error, other times it is multiple errors.

To Reproduce
Steps to reproduce the behavior:

  1. Open ps-adminmenu
  2. Go to 'Actions' tab
  3. Select any action (possibly the same action multiple times)
  4. Error pops up in F8 menu

Screenshots
image

Additional context
For reference, when I was using the menu, I specifically was using the "Toggle Laser" action.

I un-minified the code to narrow the error and it seems to be coming from this snippet here: ps-adminmenu/html/index.js line 630

async function fe(n, e = {}, l) {
	if ((Ot == !0 && l) || Ot == !0) return Promise.resolve(l || {});
	const t = {
			method: "post",
			headers: { "Content-Type": "application/json; charset=UTF-8" },
			body: JSON.stringify(e),
		},
		r = window.GetParentResourceName ? window.GetParentResourceName() : Nn;
	return await (await fetch(`https://${r}/${n}`, t)).json();
}

where line 630 is the return await (await fetch(`https://${r}/${n}`, t)).json();

I'm guessing whatever URL its generating isn't returning anything causing an error to be thrown.

@Project-Sloth Project-Sloth deleted a comment from joeymarkcodes May 16, 2024
@wiopx
Copy link

wiopx commented Jun 15, 2024

happen doing other actions aswell like opening stashes/player's inventory

@Mathu-lmn
Copy link
Contributor

It happens because some nui callbacks aren't registered, like getVehicle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants