Tesla Inc.’s TSLA 2.21% generated a record quarterly profit as the car maker largely sidestepped the effects of a global chip shortage that has constricted production for many global auto makers.

The Silicon Valley electric-car maker, as it posted second-quarter earnings on Monday, said its ability to navigate ongoing supply-chain challenges would help dictate its pace of growth in the second half of the year as it races to satisfy growing demand for battery-powered vehicles.

In a sign of the challenges the company faces in introducing new models and securing parts for all its vehicles, Tesla again delayed its semitrailer truck—already two years late—with first deliveries now slated for 2022. Tesla attributed the delay to supply-chain issues and limited battery-cell supply, as well as wanting to focus on getting new factories online.

The company’s plans for its first pickup truck, once expected to go to customers as early as this year, are also being affected by parts issues, Chief Executive Elon Musk said on an earnings call, without giving a revised first delivery date.

The company reported revenue of roughly $12 billion for the period ended June 30, nearly double the year-ago period, and a profit of $1.1 billion, marking its eighth sequential quarter in the black. Wall Street expected Tesla to report roughly $11.4 billion in revenue and around $600 million in profit, according to analysts surveyed by FactSet.

Tesla produced more than 206,000 vehicles in the second quarter, more than doubling its output from the year-ago quarter, when the rise of the Covid-19 pandemic limited production and consumer purchasing.

Global auto sales have cooled somewhat during 2021 amid a shortfall of semiconductors. Many auto makers, including Ford Motor Co. F 1.52% and General Motors Co. , have been forced to idle assembly plants over supply constraints, squeezing vehicle inventories and pushing up prices.

“For the rest of this year, our growth rate will be determined by the slowest part in our supply chain,” Mr. Musk said. “Chip supply is fundamentally the governing factor on our output.”

He added that the company navigated the semiconductor shortage by substituting alternative chips and developing software for them. A limiting factor in the quarter was the availability of modules that control vehicle air bags and seat belts, Mr. Musk said.

“That limited our production severely world-wide,” he said.

Given strong U.S. demand, most vehicles built at Tesla’s lone U.S. facility in California went to satisfy domestic buyers, the company said. European demand, Tesla said, is outpacing supply. The company said its plant in China now serves as its main vehicle-export hub.

Tesla, which delivered nearly half a million vehicles to customers last year, reiterated plans to boost that figure by more than 50% this year. However, it said growth would depend on factors including equipment capacity and supply-chain stability. Supply-chain challenges and factory upgrades caused minor interruptions in Shanghai, Tesla said.

Analysts expect Tesla to continue to be able to increase output, forecasting around 231,000 vehicle deliveries for the current quarter.

Tesla, in the quarter ended June 30, also has had to grapple with other issues. Tesla poured $1.5 billion into bitcoin earlier this year and briefly accepted the cryptocurrency as payment for its vehicles. It hit pause in May over concerns about the energy used to power bitcoin mining.