Condensed Consolidated Statement of Shareholder's Equity - USD ($) shares in Thousands, $ in Thousands | Total | Standby equity purchase agreement | PIPE | Pre-Paid Advance Agreement | Legal Settlement | VDL Nedcar | Walmart Inc | Common stock | Common stock Standby equity purchase agreement | Common stock PIPE | Common stock Pre-Paid Advance Agreement | Common stock Legal Settlement | Common stock VDL Nedcar | Additional paid-in capital | Additional paid-in capital Standby equity purchase agreement | Additional paid-in capital PIPE | Additional paid-in capital Pre-Paid Advance Agreement | Additional paid-in capital Legal Settlement | Additional paid-in capital VDL Nedcar | Additional paid-in capital Walmart Inc | Accumulated deficit |
Balance at the beginning of the 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 (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 | | | | | | | | | | | | | | | | | | | | 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 at the end of the 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 at the beginning of the 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 | (208,656) | | | | | | | | | | | | | | | | | | | | |
Net loss and comprehensive loss | (208,656) | | | | | | | | | | | | | | | | | | | | |
Balance at the end of the period (in shares) at Sep. 30, 2021 | | | | | | | | 237,603 | | | | | | | | | | | | | |
Balance as of end of period at Sep. 30, 2021 | 461,468 | | | | | | | $ 24 | | | | | | 1,015,461 | | | | | | | (554,017) |
Balance at the beginning of the 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 (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 | | | | | | | | | | | | | | | | | | | | 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 at the end of the 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) |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | | | | | | | | | |
Proceeds from exercise of public warrants (in shares) | | | | | | | | 1 | | | | | | | | | | | | | |
Proceeds from exercise of public warrants | 12 | | | | | | | | | | | | | 12 | | | | | | | |
Repurchase of unvested shares - forfeitures (shares) | | | | | | | | (391) | | | | | | | | | | | | | |
Repurchase of unvested shares – forfeitures | (3) | | | | | | | | | | | | | (3) | | | | | | | |
Issuance of shares for restricted stock units vested (in shares) | | | | | | | | 418 | | | | | | | | | | | | | |
Issuance of shares for restricted stock units vested | 0 | | | | | | | | | | | | | | | | | | | | |
Issuance of shares upon exercise of vested stock options (in shares) | | | | | | | | 12 | | | | | | | | | | | | | |
Issuance of shares upon exercise of vested stock options | 0 | | | | | | | | | | | | | | | | | | | | 0 |
Stock-based compensation | 19,098 | | | | | | | | | | | | | 19,098 | | | | | | | |
Net loss and comprehensive loss | (80,875) | | | | | | | | | | | | | | | | | | | | (80,875) |
Net loss and comprehensive loss | (80,875) | | | | | | | | | | | | | | | | | | | | (80,875) |
Balance at the end of the period (in shares) at Sep. 30, 2021 | | | | | | | | 237,603 | | | | | | | | | | | | | |
Balance as of end of period at Sep. 30, 2021 | $ 461,468 | | | | | | | $ 24 | | | | | | 1,015,461 | | | | | | | (554,017) |
Balance at the beginning of the 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 (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 at the end of the 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 at the beginning of the 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 | (407,464) | | | | | | | | | | | | | | | | | | | | |
Net loss and comprehensive loss | $ (407,464) | | | | | | | | | | | | | | | | | | | | |
Balance at the end of the period (in shares) at Sep. 30, 2022 | 299,868 | | | | | | | | | | | | | | | | | | | | |
Balance as of end of period at Sep. 30, 2022 | $ 227,871 | | | | | | | 29 | | | | | | 1,327,435 | | | | | | | (1,099,593) |
Balance at the beginning of the 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 (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, PPA and Legal Settlement (in shares) | | | | | | | | | 14,236 | 13,699 | 27,015 | 2,034 | | | | | | | | | |
Issuance of shares | | $ 33,083 | $ 50,000 | $ 81,909 | $ 5,532 | | | | $ 1 | $ 1 | $ 3 | | | | $ 33,082 | $ 49,999 | $ 81,906 | $ 5,532 | | | |
Recognition of vested Walmart warrants | | | | | | | $ 50,175 | | | | | | | | | | | | | $ 50,175 | |
Offering costs for the issuance of shares | (1,233) | | | | | | | | | | | | | (1,233) | | | | | | | |
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 at the end of the 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) |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | | | | | | | | | | | |
Repurchase of unvested shares - forfeitures (shares) | | | | | | | | (176) | | | | | | | | | | | | | |
Repurchase of unvested shares – forfeitures | (3) | | | | | | | | | | | | | (3) | | | | | | | |
Issuance of shares for restricted stock units vested (in shares) | | | | | | | | 1,245 | | | | | | | | | | | | | |
Issuance of shares for restricted stock units vested | 0 | | | | | | | | | | | | | | | | | | | | |
Issuance of shares upon exercise of vested stock options (in shares) | | | | | | | | 24 | | | | | | | | | | | | | |
Issuance of shares upon exercise of vested stock options | 0 | | | | | | | | | | | | | | | | | | | | |
Issuance of shares under employee stock purchase plan (in shares) | | | | | | | | 830 | | | | | | | | | | | | | |
Issuance of shares under employee stock purchase plan | 1,324 | | | | | | | | | | | | | 1,324 | | | | | | | |
Stock-based compensation | 19,527 | | | | | | | | | | | | | 19,527 | | | | | | | 0 |
Net loss and comprehensive loss | (117,705) | | | | | | | | | | | | | | | | | | | | (117,705) |
Net loss and comprehensive loss | $ (117,705) | | | | | | | | | | | | | | | | | | | | (117,705) |
Balance at the end of the period (in shares) at Sep. 30, 2022 | 299,868 | | | | | | | | | | | | | | | | | | | | |
Balance as of end of period at Sep. 30, 2022 | $ 227,871 | | | | | | | $ 29 | | | | | | $ 1,327,435 | | | | | | | $ (1,099,593) |