esp 01 resets caused by EMI / EMF

Hi, i have a problem which i have been struggling with for days without a resolution, hence this post. I am using this module

Everything works fine with a normal light bulb, however, the moment i change the load to a LED lamp or a fan the esp keeps resetting. I have tried all the "remedies" which i could find
a. Large cap across vcc of esp 01 - 1000uf
b. small cap across vcc of esp 01 - 0.1uf
c. MOV across relay contact
d. MOV across LED bulb

none of these help.

I measured the signals with a DSO across the esp pins and found that the vcc, reset, ch_pd dont have emi or spikes.

However, GPIO0 which is connected to the relay via 817c optoisolator and 2N7002 did have significant emi. For this i placed a .1uf and then a 1uf cap across gpio 0, this helped a bit but nowhere what is needed.

Please advise what else can be done to resolve this issue.

Do you have a photo of the layout of the whole circuit? Perhaps you have a big loop that's picking
up interference.

MarkT:
Do you have a photo of the layout of the whole circuit? Perhaps you have a big loop that's picking
up interference.

I'll take a photo of the rear of the module and post. However, wouldn't that interference be visible on the scope? I can't see anything on any pin except gpio 0, which was also surprising given the optoisolator present

Q: can a positive pulse above 3.3v on gpio 0 cause a reset?

Image of PCB layout attached