Giter Site home page Giter Site logo

Error on yarn and webpack about fivem HOT 7 CLOSED

IzioDev avatar IzioDev commented on July 29, 2024
Error on yarn and webpack

from fivem.

Comments (7)

frebib avatar frebib commented on July 29, 2024

Apologies if I'm missing something, but I'm not sure what you're trying to achieve here.
Are you trying to add/build something in the container?
It'd be good to know what commands you're running both to start the container and inside it. A simple reproducer that I can try would be helpful.

from fivem.

IzioDev avatar IzioDev commented on July 29, 2024

Hi, sorry, I'm just trying to run the cfx base resources like yarn, webpack and screenshot-basic.

I found a part of the issue.

Here is what a fork process is on NodeJs :

Fork is a special instance of spawn, that runs a fresh instance of the V8 engine.
Meaning, you can essentially create multiple workers, running on the exact same Node code base,
or perhaps a different module for a specific task.
This is most useful for creating a worker pool.
While node's async event model allows a single core of a machine to be used fairly efficiently,
it doesn't allow a node process to make use of multi core machines.
Easiest way to accomplish this is to run multiple copies of the same program, on a single processor.

Ok so it does create a new V8 instance, for instance, the custom v8 one defined here : https://github.com/citizenfx/fivem/blob/29400ece2a7185da725e7be4335e2ef044a6041b/code/components/citizen-scripting-v8/src/V8ScriptRuntime.cpp#L1884-L1889

To add more context around this, here is the code of the yarn resource that want to fork a process : https://github.com/citizenfx/cfx-server-data/blob/7680f316a7a128ca09d27101dac572098c111242/resources/%5Bsystem%5D/%5Bbuilders%5D/yarn/yarn_builder.js#L44-L49

Obvisouly, that's where the bad option --library-path comes from. So why the option is recognized on a basic linux system and not in the container ? I don't know really why

from fivem.

Adam-Ant avatar Adam-Ant commented on July 29, 2024

Hi, just echoing what @frebib is saying here - a docker run line or a compose file would be useful to help us replicate this. A modlist would be helpful too - the image is tested with the base version of FiveM so even if the issue is in the base container we'd need some of your mods to attempt to replicate. If you could find the minimum viable amount that triggers the issue, that would also help a lot!

To give you a bit of background: the FiveM project packages a full filesystem designed for running the server, all we really do is shove it into a docker container. This should mean there is no difference between our image and running outside of docker, but theory and practice are two very different things.

from fivem.

IzioDev avatar IzioDev commented on July 29, 2024

Ok, sorry.

I'm able to reproduce with a fresh install. So basically :

  1. Create a docker container with your image and just add this to your server.cfg :
# add these basic resource (found in cfx-server-data)
ensure yarn
ensure webpack
ensure screenshot-basic

You'll have this output
_fivem_test_logs.txt

I have added the server-data just in case fivem-test-data.zip

from fivem.

Adam-Ant avatar Adam-Ant commented on July 29, 2024

Well after a few hours of bashing our heads against the linux library loaders, we've replicated what the official FiveM run script does and this seems to have fixed it. To be frank we have no idea why - the implicit libraries are identical to the ones in the citizen-fx dir & we respected the other library paths it loaded in. I suspect its something very janky in the way FiveM calls yarn!

The CI is building an image now - please let us know if this doesn't fix the issue.

from fivem.

IzioDev avatar IzioDev commented on July 29, 2024

from fivem.

IzioDev avatar IzioDev commented on July 29, 2024

@Adam-Ant It works like a charm, thanks you for your reactivity ❤️

from fivem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.