HTML5 Particle systems not working in HTML5


My game functions fine when running on desktop, but when I build in HTML5 "part_system_create_layer" and other related functions return undefined. I have a global variable that is assigned like so: global.P_System = part_system_create_layer(layer, true); (copied straight from the gms2 particle system tutorial), and when "variable_global_exists("P_System")" is ran, it returns neither false nor true. After a couple of hours of googling, I found and similar users who had this issue. But after further research, I found that this bug was fixed a while ago. I am running the latest version of GameMaker Studio 2 (2.2.5), so I should not be having this problem. Also, when "global.P_System = part_system_create_layer(layer, true); " Is ran in the game start event, nothing appears when ran. When I put that in another event, Everything seems fine, but when I try to create particles, the game crashes with "cannot convert undefined to number" ,I believe this is because global.P_system is undefined (code in spoiler).

Either this bug is still around or I'm just missing something stupid.

My code:
if not variable_global_exists("P_System")
show_debug_message("not exist")
global.P_System = part_system_create_layer(layer, true);

if variable_global_exists("P_System")

nothing is printed from above code.
I can recall and print other global variables, but not P_System.

global.Particle1 = part_type_create();
part_type_shape(global.Particle1, pt_shape_flare);

part_type_size(global.Particle1, 0.01, 0.05, -0.1, 0.5);

part_type_color3(global.Particle1, c_aqua, c_lime, c_red);

part_type_alpha3(global.Particle1, 0.5, 1, 0);

part_type_speed(global.Particle1, 5, 7, -0.10, 0);

part_type_direction(global.Particle1, 0, 360, 0, 20);

part_type_blend(global.Particle1, true);

part_type_life(global.Particle1, 20, 40);

when I want to make particles:

part_particles_create(global.P_System, x, y, global.Particle1, 50);

the error message I get is "cannot convert undefined to number" I believe this is because global.P_system is undefined