salesforce / lwc

⚡️ LWC - A Blazing Fast, Enterprise-Grade Web Components Foundation
https://lwc.dev
Other
1.62k stars 394 forks source link

Seeing wrong Dynamic Components error in VS Code #3945

Open albarivas opened 8 months ago

albarivas commented 8 months ago

Description

Seeing "Invalid dynamic components usage, lwc:component and lwc:is can only be used when dynamic components have been enabled." on VS Code, while I have the capability correctly enabled in my meta file:

Screenshot 2024-01-17 at 13 43 57

Steps to Reproduce

html file:

<template>
            <lwc:component
                lwc:is={componentConstructor}
            ></lwc:component>
</template>

meta file:

<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>59.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
    </targets>
    <capabilities>
        <capability>lightning__dynamicComponent</capability>
    </capabilities>
</LightningComponentBundle>

Expected Results

No error is shown

Actual Results

Error is shown

I'm using a Spring '24 demo org, and my CLI and VS Code extensions are up to date.

jmsjtu commented 8 months ago

Thanks for opening this issue @albarivas, I believe this is an issue with the VS Code extension. I'll reach out to the team and see if we can get it updated.