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

[Bug] require bug when ox_lib is loaded more than once #545

Closed
whyauthentic opened this issue Apr 9, 2024 · 9 comments
Closed

[Bug] require bug when ox_lib is loaded more than once #545

whyauthentic opened this issue Apr 9, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@whyauthentic
Copy link

Describe the bug
ox_inventory isn't working with the newest ox_lib Version

To Reproduce
Steps to reproduce the behavior:

  1. Update ox_lib to the newest Version
  2. Restart your Server
  3. Join your Server
  4. See error on Client Side

Expected behavior
Normal Loading and Function from ox_inventory

Screenshots
image

@whyauthentic whyauthentic added the bug Something isn't working label Apr 9, 2024
@Manason

This comment was marked as off-topic.

@thelindat
Copy link
Member

thelindat commented Apr 10, 2024

image

glm isn't even technically loaded by ox_lib; the first package searcher/loader is the standard require function provided by cfx.

https://github.com/overextended/ox_lib/blob/master/imports/require/shared.lua#L94-L100

@Manason

This comment was marked as off-topic.

@xPiwel
Copy link

xPiwel commented Apr 10, 2024

Same issue here since 3.19.0 (not fixed with 3.19.1). Works fine with 3.18.0

image

@Envi-Scripts

This comment was marked as off-topic.

@Manason

This comment was marked as off-topic.

@thelindat
Copy link
Member

the issues here are reproducible

Our definitions of "reproducible" are clearly very different.

The images you posted aren't even related to the issue being reported; one of them doesn't even reference ox_lib, and two of them are waitFor timeout errors due to you having too many assets loaded and failing to load more.

@thelindat
Copy link
Member

thelindat commented Apr 11, 2024

Freshly installed ESX-Ox recipe does not have the reported issue either.

image

Changing the name of the module being loaded to specifically invoke an error also gives a different (and expected) error message.

[ 323141] [b3095_GTAProce] UV loop: httpClient/ Required resources: ox_inventory
[ 323156] [b3095_GTAProce] MainThrd/ Creating script environments for ox_inventory
[ 323172] [b3095_GTAProce] MainThrd/ ^5[ox_inventory] ^3[WARN] ox_lib's class module is experimental and may break without warning.^7
[ 323172] [b3095_GTAProce] MainThrd/ ^1SCRIPT ERROR: @ox_lib/imports/require/client.lua:179: module 'glmerr' not found
[ 323172] [b3095_GTAProce] MainThrd/ no field package.preload['glmerr']
[ 323172] [b3095_GTAProce] MainThrd/ no file '@ox_lib/glmerr.lua'
[ 323172] [b3095_GTAProce] MainThrd/ no file '@ox_lib/glmerr/init.lua'^7
[ 323172] [b3095_GTAProce] MainThrd/ ^3> require^7 (^5@ox_lib/imports/require/client.lua^7:179)
[ 323172] [b3095_GTAProce] MainThrd/ ^3> fn^7 (^5@ox_lib/imports/zones/client.lua^7:1)
[ 323172] [b3095_GTAProce] MainThrd/ ^3> loadModule^7 (^5@ox_lib/init.lua^7:54)
[ 323172] [b3095_GTAProce] MainThrd/ ^3> index^7 (^5@ox_lib/init.lua^7:69)
[ 323172] [b3095_GTAProce] MainThrd/ ^3> ref^7 (^5@ox_target/client/api.lua^7:28)
[ 323172] [b3095_GTAProce] MainThrd/ ^3> createCraftingBench^7 (^5@ox_inventory/modules/crafting/client.lua^7:57)
[ 323172] [b3095_GTAProce] MainThrd/ ^3> result^7 (^5@ox_inventory/modules/crafting/client.lua^7:99)
[ 323172] [b3095_GTAProce] MainThrd/ ^3> require^7 (^5@ox_lib/imports/require/client.lua^7:170)
[ 323172] [b3095_GTAProce] MainThrd/ ^3> result^7 (^5@ox_inventory/client.lua^7:112)
[ 323172] [b3095_GTAProce] MainThrd/ ^3> require^7 (^5@ox_lib/imports/require/client.lua^7:170)
[ 323172] [b3095_GTAProce] MainThrd/ ^3> fn^7 (^5@ox_inventory/init.lua^7:196)
[ 323172] [b3095_GTAProce] MainThrd/ ^1SCRIPT ERROR: @ox_inventory/modules/crafting/client.lua:57:
[ 323172] [b3095_GTAProce] MainThrd/ ^5 An error occurred while calling export addBoxZone in resource ox_target:
[ 323172] [b3095_GTAProce] MainThrd/ nil
[ 323172] [b3095_GTAProce] MainThrd/ ^5 ---^7

Yours somehow shows the field package and no file lines twice.

@thelindat thelindat changed the title [Bug] ox_inventory isn't working properly with the newest ox_lib version [Bug] require bug when ox_lib is loaded more than once Apr 11, 2024
@thelindat
Copy link
Member

Normal Loading and Function from ox_inventory

As shown in your stack trace the error is in ox_target and not ox_inventory; it's also only an issue in older versions of ox_target and was fixed with v1.14.0.

AusHick pushed a commit to BStarRP/ox_lib that referenced this issue May 4, 2024
AusHick pushed a commit to BStarRP/ox_lib that referenced this issue May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants