I made a LWC to hold common CSS I want to import across different LWCs that I am working on.
Based on these release notes I created a component called myComponent and tried to import it in the CSS portion of one of my other LWCs, let's call it consumerComponent.
Here's my code.
myComponent Metadata:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>49.0</apiVersion>
<description>My Component</description>
<isExposed>false</isExposed>
<masterLabel>My Component</masterLabel>
</LightningComponentBundle>
myComponent CSS:
Holds a bunch of css
consumerComponent
@import 'c/myComponent';
The API version of the consumerComponent is also 49
.
However I am getting the following error: Error during LWC component connect phase: [Class constructor MyComponent cannot be invoked without 'new']
.
Any ideas or leads for this?