I have the same problem....It started many years ago when me and my buddy made some cannaoil(simply cooked the weed in veg.oil) and i ate a lot of that stuff whit bread...i got so baked that i was thinking i'm gonna die....i was laying in my bed, my ears rang really strong, i felt like the bed slided away and i was falling, but 1 sec later i was back in my bed...then the bed slided away again...and so on....It was really bad, i was thinking, if this shit won't stop in 30min, i'm gonna jump out of the window, or do something to myself....but it stopped...
Some time later i was somkin whit a few buddys some really good weed, i took way too many hits from the bong, and this bad feeling returned...my ears started to ring, i felt like i gonna get a heart attack, and i had this strange feeling...if i turned my head to the side, i felt like my brain is falling out of my head...it was really bad...
From then on, i had the same problems as many here...if i smoke weed i get a panic attack...
But i realized this is only psychological, and now i enjoy smoking again...
What helped me was, i only took 1-2 hits in the (re)beginning....if i feel the panic coming i go for a walk, take a ride whit a bicycle, drink water, i keep myself busy whit something so i don't pay attention to the faster heart rate, and i KNOW this is only in my head, i will not get a heart attack, i just simply calm myself...I don't smoke that much now so i get really baked, and i enjoy smoking, eating mj again...