The Atanasoff–Berry computer was even earlier (working prototype in 1942, but much of the design had already been done by 1940).
This was not a general-purpose computer, but a computer made with vacuum tubes that was dedicated to solving a single kind of problem, the solution of systems of linear equations.
The Atanasoff–Berry computer not only used vacuum tubes for computation, but it also included the first DRAM memory, which was made with discrete capacitors.
The report “Computing Machine for the Solution of Large Systems of Linear Algebraic Equations”, written by John V. Atanasoff in 1940, demonstrates a very good understanding for that time of the principles on which electronic computing circuits and memories should be based.
Moreover, the electronic circuits used in the Atanasoff–Berry computer have been a source of inspiration for the later ENIAC, because one of the members of the ENIAC team has made a visit there, inquiring about details of the computer.
While the Atanasoff–Berry computer is likely to have been the first which has used vacuum tubes for computation, it has been derived from a series of British inventions made during the previous decade, which were used for making electronic counters used in nuclear and particle physics research, for measuring ionizing radiation.
The electronic counters had been the first application of digital circuits made with vacuum or gas tubes, before automatic computers. The well-known high speed of the electronic counters is what has suggested the application of vacuum tubes for computing, both in USA with ABC, then ENIAC, and in UK, with Colossus.