Condensed Consolidated Statement of Shareholder's Equity - USD ($) shares in Thousands, $ in Thousands | Total | SEPA | PIPE | VDL Nedcar | Common stock | Common stock SEPA | Common stock PIPE | Common stock VDL Nedcar | Additional paid-in capital | Additional paid-in capital SEPA | Additional paid-in capital PIPE | Additional paid-in capital VDL Nedcar | Accumulated deficit |
Balance as of beginning of period (in shares) at Dec. 31, 2020 | | | | | 235,753 | | | | | | | | |
Balance as of beginning of period at Dec. 31, 2020 | $ 565,242 | | | | $ 24 | | | | $ 910,579 | | | | $ (345,361) |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | |
Proceeds from exercise of public warrants (in shares) | | | | | 597 | | | | | | | | |
Proceeds from exercise of public warrants | 6,867 | | | | | | | | 6,867 | | | | |
Repurchase of unvested shares - forfeitures (in shares) | | | | | (118) | | | | | | | | |
Repurchase of unvested shares – forfeitures | (2) | | | | | | | | (2) | | | | |
Issuance of shares for restricted stock units vested (in shares) | | | | | 1,230 | | | | | | | | |
Issuance of shares for restricted stock units vested | 0 | | | | | | | | | | | | |
Issuance of shares upon exercise of vested stock options (in shares) | | | | | 37 | | | | | | | | |
Issuance of shares upon exercise of vested stock options | 0 | | | | | | | | | | | | |
Stock-based compensation | 45,146 | | | | | | | | 45,146 | | | | |
Conversion of private placement warrants to public warrants | 8,252 | | | | | | | | 8,252 | | | | |
Net loss and comprehensive loss | (15,227) | | | | | | | | | | | | (15,227) |
Net loss and comprehensive loss | (15,227) | | | | | | | | | | | | (15,227) |
Balance as of end of period (in shares) at Mar. 31, 2021 | | | | | 237,499 | | | | | | | | |
Balance as of end of period at Mar. 31, 2021 | 610,278 | | | | $ 24 | | | | 970,842 | | | | (360,588) |
Balance as of beginning of period (in shares) at Dec. 31, 2020 | | | | | 235,753 | | | | | | | | |
Balance as of beginning of period at Dec. 31, 2020 | 565,242 | | | | $ 24 | | | | 910,579 | | | | (345,361) |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | |
Conversion of private placement warrants to public warrants | 8,252 | | | | | | | | | | | | |
Net loss and comprehensive loss | (127,780) | | | | | | | | | | | | |
Net loss and comprehensive loss | (127,780) | | | | | | | | | | | | |
Balance as of end of period (in shares) at Jun. 30, 2021 | | | | | 237,563 | | | | | | | | |
Balance as of end of period at Jun. 30, 2021 | 523,236 | | | | $ 24 | | | | 996,354 | | | | (473,142) |
Balance as of beginning of period (in shares) at Mar. 31, 2021 | | | | | 237,499 | | | | | | | | |
Balance as of beginning of period at Mar. 31, 2021 | 610,278 | | | | $ 24 | | | | 970,842 | | | | (360,588) |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | |
Repurchase of unvested shares - forfeitures (in shares) | | | | | (56) | | | | | | | | |
Repurchase of unvested shares – forfeitures | (2) | | | | | | | | (2) | | | | |
Issuance of shares for restricted stock units vested (in shares) | | | | | 114 | | | | | | | | |
Issuance of shares for restricted stock units vested | 0 | | | | | | | | | | | | |
Issuance of shares upon exercise of vested stock options (in shares) | | | | | 6 | | | | | | | | |
Issuance of shares upon exercise of vested stock options | 0 | | | | | | | | | | | | |
Stock-based compensation | 25,514 | | | | | | | | 25,514 | | | | |
Net loss and comprehensive loss | (112,554) | | | | | | | | | | | | (112,554) |
Net loss and comprehensive loss | (112,554) | | | | | | | | | | | | (112,554) |
Balance as of end of period (in shares) at Jun. 30, 2021 | | | | | 237,563 | | | | | | | | |
Balance as of end of period at Jun. 30, 2021 | 523,236 | | | | $ 24 | | | | 996,354 | | | | (473,142) |
Balance as of beginning of period (in shares) at Dec. 31, 2021 | | | | | 238,578 | | | | | | | | |
Balance as of beginning of period at Dec. 31, 2021 | 343,999 | | | | $ 24 | | | | 1,036,104 | | | | (692,129) |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | |
Repurchase of unvested shares - forfeitures (in shares) | | | | | (296) | | | | | | | | |
Repurchase of unvested shares – forfeitures | (3) | | | | | | | | (3) | | | | |
Issuance of shares for restricted stock units vested (in shares) | | | | | 584 | | | | | | | | |
Issuance of shares for restricted stock units vested | 0 | | | | | | | | | | | | |
Issuance of shares upon exercise of vested stock options (in shares) | | | | | 20 | | | | | | | | |
Issuance of shares upon exercise of vested stock options | 0 | | | | | | | | | | | | |
Purchase of shares by VDL Nedcar (in shares) | | | | | | | | 972 | | | | | |
Purchase of shares and warrants by VDL Nedcar | | | | $ 8,400 | | | | | | | | $ 8,400 | |
Stock-based compensation | 20,680 | | | | | | | | 20,680 | | | | |
Net loss and comprehensive loss | (125,367) | | | | | | | | | | | | (125,367) |
Net loss and comprehensive loss | (125,367) | | | | | | | | | | | | (125,367) |
Balance as of end of period (in shares) at Mar. 31, 2022 | | | | | 239,858 | | | | | | | | |
Balance as of end of period at Mar. 31, 2022 | 247,709 | | | | $ 24 | | | | 1,065,181 | | | | (817,496) |
Balance as of beginning of period (in shares) at Dec. 31, 2021 | | | | | 238,578 | | | | | | | | |
Balance as of beginning of period at Dec. 31, 2021 | 343,999 | | | | $ 24 | | | | 1,036,104 | | | | (692,129) |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | |
Conversion of private placement warrants to public warrants | 0 | | | | | | | | | | | | |
Net loss and comprehensive loss | (289,757) | | | | | | | | | | | | |
Net loss and comprehensive loss | (289,757) | | | | | | | | | | | | |
Balance as of end of period (in shares) at Jun. 30, 2022 | | | | | 268,896 | | | | | | | | |
Balance as of end of period at Jun. 30, 2022 | 188,345 | | | | $ 26 | | | | 1,170,207 | | | | (981,888) |
Balance as of beginning of period (in shares) at Mar. 31, 2022 | | | | | 239,858 | | | | | | | | |
Balance as of beginning of period at Mar. 31, 2022 | 247,709 | | | | $ 24 | | | | 1,065,181 | | | | (817,496) |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | |
Repurchase of unvested shares - forfeitures (in shares) | | | | | (175) | | | | | | | | |
Repurchase of unvested shares – forfeitures | (3) | | | | | | | | (3) | | | | |
Issuance of shares for restricted stock units vested (in shares) | | | | | 1,017 | | | | | | | | |
Issuance of shares for restricted stock units vested | 0 | | | | | | | | | | | | |
Issuance of shares - SEPA and PIPE (in shares) | | | | | | 14,236 | 13,699 | | | | | | |
Issuance of shares | | $ 33,083 | $ 50,000 | | | $ 1 | $ 1 | | | $ 33,082 | $ 49,999 | | |
Issuance of shares upon exercise of vested stock options (in shares) | | | | | 7 | | | | | | | | |
Issuance of shares upon exercise of vested stock options | $ 0 | | | | | | | | | | | | |
Issuance of shares under employee stock purchase plan (in shares) | 254 | | | | | | | | | | | | |
Issuance of shares under employee stock purchase plan | $ 1,175 | | | | | | | | 1,175 | | | | |
Stock-based compensation | 20,773 | | | | | | | | 20,773 | | | | |
Net loss and comprehensive loss | (164,392) | | | | | | | | | | | | (164,392) |
Net loss and comprehensive loss | (164,392) | | | | | | | | | | | | (164,392) |
Balance as of end of period (in shares) at Jun. 30, 2022 | | | | | 268,896 | | | | | | | | |
Balance as of end of period at Jun. 30, 2022 | $ 188,345 | | | | $ 26 | | | | $ 1,170,207 | | | | $ (981,888) |