"Main markup cannot be empty" error saving Lightning Component API v42.0

Issue #878 resolved
Doug Ayers created an issue

This may or may not already be handled by what's hinted at for Spring '18 support per issue 873.

In Spring '18, a new validation for lightning components disallows <style> tags (release notes). I have a component whose markup (.cmp) has a <style> tag. When I changed the *-meta.xml file to have <apiVersion>42.0</apiVersion> then saved it / deployed it I got an error (expected) but not a message that would have indicated the true problem.

The error I received was:

2/10/18 11:00 PM Deployment Failed ERROR deploying AuraDefinitionBundle : Main markup cannot be empty. If you are trying to delete the Lightning definition bundle, directly delete the bundle instead.

When I downgraded the API to v41.0 then the component saves fine -- that's when I went to the release notes to review any possible breaking changes and voila, I found one.

I'm logging this here as an FYI in case the save API call might be returning a better error message and so IC2 could be updated to reflect that.

I've tried with both IC2 2.0.0.8 and IC2 2.0.0.9 in Webstorm for Mac OSX.

Thanks!

Comments (5)

  1. Scott Wells repo owner

    Thanks for logging. Yeah, I tried the same thing in 42.0 and got a similarly vague message. So the good news is that it fails since it's documented to fail, but the bad news is that if you ever got that failure, you'd have zero idea why it was failing. I think that perhaps a first-class code inspection would go a long way toward relieving frustration. I'll use this issue to investigate options.

  2. Scott Wells repo owner

    Well, after debugging a bit I found the root cause issue and it was a bug in how IC parses certain types of Lightning compilation error responses. I've already implemented a fix and will include it in tomorrow's build.

  3. Log in to comment