Karma go return

Inside the Fisker Karma’s Impossible Return From Automotive Hell

Carl Jenkins just wanted to go for a drive. The San Bernardino Mountains promised stunning alpine vistas and breathtaking views of reservoirs and lakes, and weren&#x27;t too far from his Southern California home. So on a nice Saturday afternoon in July of 2015, Jenkins and his wife set out in his new hybrid electric Fisker Karma.

They made it three miles up the canyon road before the dreaded dashboard lights blinked on: The car had overheated. “I ended up with a classic picture of my wife standing next to this gorgeous car, in gorgeous scenery, with the hood up and coolant just pouring out of it,” Jenkins says.

Back at work Monday morning, Jenkins got right to griping, like you’d expect from someone who’d lost a nice weekend to a shoddy product. But he wasn’t moaning to a sympathetic cubicle mate. Jenkins leads the engineering efforts at Karma Automotive.

You might remember Fisker. The company had once threatened to upend Detroit with a sleek, eco-minded sports car—and then crashed in a blaze of mismanagement and bad luck. Jenkins was supposed to resurrect its only product, the Karma.

That drive on the Rim of the World Scenic Byway, during his first weekend at the company, crystalized just how difficult it would be. He called in the thermal team for a blunt conversation—one of many.

Three weeks after the weekend jaunt, the thermal folks had reworked the airflow through the front of the car, a simple fix the original engineers had overlooked as they raced to market in 2011. But it was just one of hundreds of issues Jenkins and his teams had to identify.

Today, they think they’ve rectified all of them, and Jenkins and the other 600 members of the new Fisker team are ready to relaunch one of the most famous failures in the history of the auto industry. "I specifically wanted to do a 1,000-piece jigsaw, with lots of clouds and gray skies," Jenkins says. Now he’s getting his chance.

In 2008, environmental consciousness was hip, but electric cars were somewhere between lame and nonexistent. For A-listers like Leonardo DiCaprio, the apex of greenness was, if you can believe it, the egg-shaped Toyota Prius.

Henrik Fisker thought things could be different. The Danish designer had made his name with some of the loveliest cars of the past quarter century , including the BMW Z8 and Aston Martin DB9. In 2007, he went solo with a plan to bring luxury and style to the world of EVs, and charge a premium for it. Fisker snagged some VC cash and founded Fisker Automotive in Irvine, California.

They launched the vehicle a year too soon. They didn’t finish the program.

Carl Jenkins, lead engineer at Karma Automotive

The next year he unveiled the Karma. Like Chevy Volt of the same era, it had a plug-in hybrid drivetrain, powered by electricity until the battery went flat, then using a gas engine as a generator so you’d never be stranded. Unlike the Volt, it was freaking gorgeous, with curves that made it look like it was formed from a single piece of gently melted metal, and could pull zero to 60 in as little as 5.9 seconds.

As the American auto industry crumbled, Fisker offered a new way. Forbes put him on its cover under the headline, “The Next Detroit.” The US Department of Energy promised $528.7 million.

Fisker pledged to start production within 18 months. And while he would begin with the luxury market, he wanted to build affordable electric cars for the masses within a few years—the same thing Elon Musk was trying to do with Tesla Motors.

Henrik Fisker with a clay model of the Fisker Karma, in early 2010.

For a while, it worked. The Karma made it to Time ’s 50 Best Inventions, Automobile ’s Design of the Year, and Top Gear ’s Luxury Car of the Year. WIRED called it “freakin’ hot.” Al Gore put his order in early. Usher gave one to Justin Bieber, who wrapped it in chrome. DiCaprio took the first delivery in August 2011. Fisker proudly watched him drive it down LA’s Sunset Boulevard. “My idea was really to design something that came straight from the heart. No committees, nobody in any way or form told me what to do when I designed this car,” he says.

But Fisker hadn’t run an automaker before. The company’s outsource-everything, low-headcount approach yielded a car riddled with engineering problems.

As the Karma went from concept to reality and kept missing deadlines, the headlines soured: Poor reliability! Electrical fires! Late loan payments! The price of the Karma steadily rose. Fisker first announced an MSRP around $80,000. By production time, it started at six figures.

How GM Beat Tesla to the First True Mass-Market Electric Car

Meet Tesla’s Model 3, Its Long-Awaited Car for the Masses

VW’s $15B Diesel Apology Could Finally Push EVs Mainstream

As Fisker ran through cash and missed deadlines, the DOE quietly froze its funding in May 2011; it had doled out nearly $200 million. Desperate to keep cash flowing, Fisker started selling vehicles too quickly, before properly addressing the Karma’s myriad problems.

“Really they launched the vehicle a year too soon,” says Jenkins. “They didn’t finish the program.”

In 2012, Consumer Reports flunked the luxury sedan, citing “unfortunately routine problems” with the battery and a series of trips back to the dealer, along with a cramped interior, long recharge times, a noisy engine, and substandard performance.

The company was working at the forefront of automotive technology. Fisker had to teach his suppliers how to make some necessary components. When his sole battery supplier, Massachusetts-based A123, went bust, "that was a disaster for us," he says.

Fisker Automotive went bankrupt in 2013.

A year later, Chinese auto parts giant Wanxiang Group bought the company’s assets and what remained of A123. At $150 million, it was a fire sale price on the parts Wanxiang needed to launch an electric car effort of its own. Today, Wanxiang is funding a comeback story. Think of it as a reboot; now it’s Karma Automotive’s Revero—nothing to do with Henrik Fisker.

The new Karma team, in Moreno Valley, California, has spent the past 27 months eliminating the car’s many flaws and updating it with five years of technical advances. They studied feedback from owners and dealers and ran three original vehicles up to 100,000 miles each. They splayed open each car—doors, trunk, and hood swung wide open—then stuck tags on every problem they could find, down to the dodgy hose clamps. “We went section by section, through the entire car, and through the entire bill of materials, asking does it need to be fixed, or is it OK?” says marketing chief Jim Taylor.

They put charts on the wall to track each problem and the money and time needed to fix it. There were a lot of charts. But the team steadily worked through every issue. It was a long ride.

The Revero's interior is lovely, but not especially practical.

The Karma Revero retains many of the quirks of the original car. The stunning exterior is much the same. It still has overly complicated electric door handles and an odd gear selector setup, with P, R, N, and D buttons that make up the sides of a pyramid. Glass inserts in the dash and the doors do nothing but look slightly retro-futuristic. The rear seats are just as cramped, and the big batteries leave little trunk space. Impracticalities are still part of the deal. The car&#x27;s famous solar roof has been updated to give that at least a bit of utility. If it&#x27;s real sunny, it can produce 200 watts of electricity per hour—enough to power 1.5 miles of emissions-free driving per day.

Unlike its predecessor, however, the Revero works. Crucially, Karma updated the drivetrain. Twin electric motors drive the rear wheels, powered by a 23-kilowatt-hour battery. General Motors makes the two-liter, four-cylinder turbocharged engine that works as a generator when power runs low. (GM’s not making the engine anymore, so once Karma runs through its stock, it’ll need a new solution.) For now, the Revero will go 50 miles on electricity and deliver 20 miles per gallon when the engine’s running. That’s a bit short of the 2016 Chevy Volt’s 53 all-electric miles and 42 mpg, but Karma’s car thrashes the Detroiter on looks and style.

“When I joined, we still had no idea where we were going to build an assembly plant,” Jenkins says. Once Karma settled on Southern California, the executive team started rebuilding relationships with suppliers, often asking them to restart making parts that were now out of production. Karma shipped over the vast inventory of unused parts Fisker had left in a Finnish warehouse, but they weren’t entirely helpful.

As Jenkins found a pile of stamped body panels, he thought, “Great, we can use these, nice and easy.” Except that his team had already decided to dump the Fisker’s overly thick wiring harness for a smaller, modern unit that takes a different path through the car. The body panels from the first Karma were full of holes for the old wires, and they could carry noise from the engine bay into the cabin. So Karma filled them in and drilled new ones.

Like the Revero, Karma's machinery is a mix of old and new.

By the time I pulled into Karma&#x27;s parking lot, Jenkins and his team had nearly finished their work. The small production team was producing a car a day, supervising each stage manually, and working to gear up production.

Still, the shiny red Revero, sitting outside in plain view, surprised me—Karma was two weeks from the public reveal of its work. Then I spied the three security guards, there to ward off wandering strangers, so Jenkins could point out his progress under a cloudless sky.

The facility is sprawling, and in the summer, sweltering. Like the car, the machinery inside is a mix of old and new. Wanxiang bought the original production line but then had to break it down and ship it from Finland to California. The riveting robots that fasten the aluminum shell together hail from Scandinavia; the paint shop is locally sourced.

I think they potentially underestimate the uphill climb they have in front of them, no matter how good the car is.

Chelsea Sexton, Electric vehicle consultant

The Revero we took for a drive, just the tenth off the production line, was wrapped in the swirling black-and-white camouflage automakers use to hide their work from cameras. Jenkins insisted on driving, leaving the parking lot for the two-lane road that runs straight through the industrial area, scraping the front bumper as he hit a dip in the street. Any modern car with an aggressive front end would have done the same, but I was glad I wasn&#x27;t at the wheel.

Once he had relaxed, Jenkins let me take over, making it my turn to be nervous. I was in command of a phoenix—or a zombie. The steering wheel is chunky, the fancy leather seats feel great. The doors shut with a satisfying thunk.

The car has the silent, punchy acceleration of an electric, but when the engine fires up, things get loud. The team is still working on reducing the noise and tuning the sound of the exhausts, which pop out just behind the front wheels. Karma won’t provide an official 0-to-60 miles per hour time yet, but I’d peg it in the low five seconds. That won’t beat Tesla’s Model S, but it’s quick enough to match the promise of the exterior design.

And—this is important—the Revero worked. No warning lights, no smoke, no runaway coolant. Phoenix it is, at least for now.

Henrik Fisker wanted to swipe the mantle of automotive innovation away from Detroit and make electric driving cool. When the new Karma starts production—likely later this year—it will settle for a niche role in the luxury market. Competing with the likes of Aston Martin and Maserati (it hopes, anyway), Taylor says the company could someday sell 1,000 to 2,000 cars a year, for $100,000 or more.

"To me there’s a satisfaction in the fact that the design is so appreciated,” says Fisker. He believes it’s timeless enough that it just might work for a revival, in the same way that the Porsche 911’s design is as desirable today as it ever was.

That’s optimistic. “I think they have one shot at this to get some attention,” says Stephanie Brinley of IHS Automotive, an auto industry consulting firm. The company’s analysts have looked at the marketplace and think Karma likely to sell 300 cars a year.

Thank the competition. In the five years since the birth of Fisker’s Karma, the automotive landscape has changed. Electric cars aren’t on every block, but Tesla’s success has set new expectations for technology and performance. Chevy is chasing the Silicon Valley darling for the affordable EV market, while Lamborghini, Bentley, BMW, Cadillac, Mercedes-Benz, Audi, and others already or plan to soon offer plug-in hybrid luxury electric cars. Karma isn’t breaking fresh ground anymore.

The car must deliver reliable performance, and rely on its looks. "It will be a great underdog story if they pull it off and do succeed," says Chelsea Sexton, an electric car consultant and advocate. "I think they potentially underestimate the uphill climb they have in front of them, no matter how good the car is."

The final test will be owners. The company’s hoping for many more photos of Reveros parked along canyon roads—without the coolant pouring out.

How do Karma, Webpack, and karma-webpack interact?

Karma is an awesome test runner for web apps. Webpack is an awesome asset compiler for web apps. Both are crazy configurable and very complex. Here&#8217;s a detailed technical rundown how they interact with each other that will either bore you to death or save you from hours of teeth gnashing.

I spent most of today wrestling with Karma and Webpack as well as karma-webpack, the Karma plugin that interfaces Karma with Webpack. What I was trying to figure out was how all three process files when the &#8216;webpack&#8217; preprocessor is configured in the Karma config file.

Here&#8217;s what I found out. (Hold on to your hats. It&#8217;s going to be a doozy.)

A Karma config file has two important sections for dealing with files: files and preprocessors .

The files section is an array containing patterns that specify the types of files that you want to include in the HTML test runner that&#8217;s generated. By default, the following will happen to/with files that are listed here after starting Karma:

Karma goes through each of the file patterns and creates handles to all files that match each pattern.

For each matching file, a file handle, the file&#8217;s contents, and a callback function are passed to any matching preprocessor. (Preprocessors are matched with file patterns using the entries in Karma config&#8217;s preprocessors section.)

The preprocessor does some work, generally on the contents of the file.

The preprocessor passes the file&#8217;s (usually modified) contents to the callback.

(If multiple preprocessors are chained for any matching pattern, the callback passes the file handle, contents, and callback to the next preprocessor, forming a loop that continues until no preprocessors remain.)

If there are no more preprocessors waiting to be applied, the processed file is stored.

If the original file pattern object had its served property set to true, the file is made available through Karma&#8217;s locally-running HTTP server. (Default served: true .)

If the original file pattern object had its included property set to true, the file gets included in the generated HTML test runner&#8217;s script tag. (Default included: true .)

To get Karma to work with Webpack, you probably know that you will need to install the karma-webpack plugin. The setup instructions tell you to modify your Karma config by adding the &#8216;webpack&#8217; preprocessor entry, something like this:

But what effect does this entry actually have and how does the karma-webpack plugin interact with Karma and Webpack?

Internally, the plugin has two components: the plugin itself and the preprocessor function. Upon starting Karma, the plugin itself is loaded by instantiating karma-webpack&#8217;s Plugin class, which is in turn is exported by the karma-webpack package as a module. We&#8217;ll deal with the preprocessor function later.

Here&#8217;s what happens when you fire up Karma, assuming that the plugin is installed and configured to be loaded (either explicitly in the Karma config file&#8217;s plugins section or by default if there is no plugins section):

The Plugin constructor does some initial setup and creates a Webpack compiler instance, passing in the webpack configuration object defined in the Karma config file. (It also overrides some of the configuration options passed in, most notably anything dealing with output, so don&#8217;t worry about clobbering your pre-existing bundles if your Karma config file sets up Webpack options with something like webpack: require('./webpack.config') .)

The Plugin constructor registers several Webpack plugins (different from the karma-webpack Karma plugin; yes, this is confusing), which are basically just callback functions that are run at different stages of Webpack&#8217;s build process. The most important one of these functions is the &#8220;make&#8221; callback, which adds assets to be compiled in addition to the dependency tree created by the configured Webpack entry point. This will be very important later.

The Plugin constructor wraps the Webpack compiler instance in a WebpackMiddlewareDev instance, which provides various functionality. Most importantly, the WebpackMiddlewareDev wrapper creates a fake in-memory filesystem using Webpack&#8217;s memory-fs module and configures the Webpack compiler to output all generated files to this filesystem.

Let&#8217;s recap. The karma-webpack plugin is loaded after starting Karma, which in turn automatically runs Webpack using whatever configuration options were passed in the webpack section of your Karma config file.

At this point, none of the files that you&#8217;ve listed in the files or preprocessors section of your config file are being processed or touched in any way whatsoever. All that&#8217;s happened so far is just an old fashioned Webpack run with the important exception that all output is being routed to an in-memory filesystem instead of being saved to disk.

Once Karma finishes loading its plugins, it starts to go through the files listed in the files section. It passes each file&#8217;s handle, contents, and a callback function (described below) to any matching preprocessors, as described above. Assuming that you&#8217;ve set up the Webpack preprocessor for a given file/file pattern, this is what karma-webpack will do:

The file handle, a string representing its contents, and a callback function are passed to karma-webpack&#8217;s preprocessor function, as described above.

The preprocessor adds each file to an internal array and calls invalidate() on the middleware-wrapped compiler instance after adding each file. invalidate() tells the compiler that compiled asset bundles are no longer good, which triggers a recompile.

Remember the &#8220;make&#8221; plugin callback that was registered when Karma was started? This time, when the compiler starts, the make plugin takes the array of files populated by the preprocessor and adds them to the compiler&#8217;s make build step.

According to Webpack&#8217;s plugin documentation, the make build step allows you to &#8220;add entries to the compilation or prefetch modules.&#8221; If you read karma-webpack&#8217;s code, you&#8217;ll understand that what this means in practice is that the files passed in from the preprocessor are passed to the SingleEntryDependency constructor, and the SingleEntryDependency instances are passed in to the addEntry method, which is what actually adds the files to the compilation as dependencies. (But dependencies of what? The compilation as a whole? It&#8217;s not clear.)

Because the preprocessor files have been added as separate dependencies, they are compiled and the output is saved to the in-memory filesystem as bundles in addition to the main bundle. Despite the fact that they are passed in as instances of a class called SingleEntryDependency, each file gets its own standalone compiled bundle file. (NOTE: I learned the hard way that these files will not be generated unless there is an entry point in your Webpack config that points to a file with the same extension as the files that are passed into the preprocessor. Hence if you&#8217;re using a library like Riot or React and you want to pass in .tag or .jsx files respectively, you MUST specify a .tag or .jsx file as at least one entry point. I think this is meant to be an optimization feature, but it was a real PITA at the time to figure out.)

At this point, control has returned to the preprocessor, which runs a function to read the newly compiled dependency-derived bundles (not the main bundle).

The contents of each read bundle are passed to the preprocessor callback.

Assuming that there are no more preprocessors to be called for the file, preprocessing ends and Karma saves the contents of the bundle into a new file.

What&#8217;s important here to note is that karma-webpack is taking the files that are passed in from the files and preprocessors sections of Karma&#8217;s config file. Those files are individually added as dependencies to the compiler&#8217;s run, compiled separately from the dependency tree , and then the compiled bundles&#8217; contents are passed back to Karma to be saved, linked to in the HTML test runner file, and served during the browser-hosted test run.

In other words, the main asset bundles that are generated by the entry points in your Webpack config are totally discarded. The entry points are discarded. Nevertheless, for each file type passed in from files and preprocessors, you must have at least one entry point ending in the same extension specified in your Webpack config or else the passed in files will not be compiled during the &#8220;make&#8221; build step. When the preprocessor tries to read the compiled files, it will then choke and Karma will crash.

I know. But if you&#8217;re trying to figure out a bug in your testing setup, hopefully I&#8217;ve saved you a headache.