State Senator Richard Pan, a physician and a Democrat, has been threatened on Facebook over his sponsorship of the bill. He told the committee that the growing use of the personal belief exemption had been identified as aiding the spread of measles from the Disneyland outbreak. “We are clearly at a point where our community immunity is dropping too low,” he said. To believe otherwise, he said, is a “luxury.”

Jay Hansen, a member of the Sacramento City Unified School District, said the measure was based on science, not emotion. “We should stand up for the scientific method we all learned in school,” he said.

But after nearly two hours of opposition testimony, doubts among committee members emerged, from both Republicans and majority Democrats. One concern was that the bill did not address what would happen to children who now have exemptions from vaccines on Jan. 1, when the law would take effect. At the end of the hearing, Senator Carol Liu, the committee chairwoman and a Democrat, told Mr. Pan that his bill lacked the votes for passage and gave him a week to fix the measure.

If the bill passes, California will become the largest state by far to bar exemptions from vaccines for any reason other than medical necessity. Only two other states, Mississippi and West Virginia, have such rules.