Node JS process.env variables are shared across resources

General guideline is: if you ‘need help’, do not post here. Post in the right support section instead.

WARNING: THIS IS NOT A HELP SECTION

If you post here without knowing what you’re doing you’ll most likely get suspended. You should probably instead post in:


For a good bug report you should probably include:

  1. Client (production/canary) and FXServer version

  2. What you expected to happen

  3. What actually happens

  4. Category of bug (eg. client, server, weapons, peds, native)

  5. Reproducible steps, preferably with example script(s)


  1. Not a client bug, just server. FXversion is cerulean, artifact version is 4394(last recomended for now)

  2. Expected to have separate process.env variables for each resource, since, for example, process’s event emitter is not shared across multiple resources

  3. If one resource sets process.env variable, other resources can access it
    Also, process.env vars are not reset on resource stop/restart

  4. Server (node runtime)

  5. Start resource server, then start resource server-2
    that’s what the console gives as output
    image

process-env-repro.rar (554 Bytes)

Process environment variables are process environment variables. These aren’t just in Node.js scope, and e.g. Lua os.putenv/os.getenv act the exact same way, but a normal Node.js environment would have the same ‘issue’ across workers since, again, this is by design.

Why are you expecting process environment variables to not be shared within the same OS process, rather?