Skip to main content
I'm in the "Setup Your LWC Developers Tools" project. I succesfully fixed the Javascript Errors in myFirstWebComponents.js, and followed the directions to fix myFirstWebComponents.html

 

The code is supposed to read:

 

<lightning-card title="ContactInformation" icon-name="custom:custom14">    <div class="slds-m-around_medium">

 

<template for:each={contacts} for:item="contact">

 

<div key={contact.Id}> {contact.Name}, {contact.Title} </div> </template> </div> </lightning-card>

 

But I'm still getting an error, LWC1079: Expected root tag to be template, found lightning-card.

 

This is literally the code it says to use, and it still doesn't work. Is there a cache I need to delete, or something I need to reset? I', unable to deploy and configure the LWC.

 

Thanks,

 

Shaun
15 件の回答
  1. Jonathan Fox (Cooper Parry) Forum Ambassador
    2020年2月11日 21:00

    <template>

    <lightning-card title="ContactInformation" icon-name="custom:custom14">

    <div class="slds-m-around_medium">

    <template for:each={contacts} for:item="contact">

    <div key={contact.Id}>

    {contact.Name}, {contact.Title}

    </div>

    </template>

    </div>

    </lightning-card>

    </template>

     

    Try this. I added <template> tags to enclose your whole code.
0/9000