Actor Bill Hader had to be hospitalised for a serious allergic reaction on the set of his new black comedy The Skeleton Twins after he was given a piece of chocolate filled with peanut butter.

The Cloudy with a Chance of Meatballs star is allergic to peanuts, but he accepted the candy from a set assistant after being reassured it was just chocolate.

However, Hader realised he was in trouble the moment he bit into the sweet treat and his throat began to close up.

He explains, "I have a peanut allergy and we were shooting a scene with Luke Wilson and someone came over to me and said, 'Hey, do you want some chocolates?', and I said, 'I have a peanut allergy' and he said, 'No, these are just chocolate, don't worry about it, there's no peanuts in this.' I go, 'Oh, great', and I put it in my mouth and it's filled with peanut butter! I went, 'This is peanut butter', and they said, 'Oh, you said peanuts...'

"So this is how I die...! My throat closes up and I can't breathe..."

Hader was taken to a nearby medical centre for treatment, but he did not expect the no-nonsense New York doctor in the emergency room (Er) to turn on him for not carrying an epinephrine autoinjector device to protect him from such health scares.

He continues, "My whole mouth is numb, I can't breathe... This has happened a couple of times to me, but not in New York, and the New York Er guy was like - he's a doctor - and he goes, 'This happened to you before?'. I go, 'Yeah', and he goes, 'Do you have an EpiPen?' I go, 'No', and he goes, 'You're a f**king idiot!'. I'm like, 'Yeah, yeah, I'm a f**king idiot.'"