You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { storiesOf } from '@storybook/html';
import AtomIconButton from './atomIconButton';
import buildAndRegisterCustomElement from '../../utils/build-custom-element';
ERROR in ./force-app/main/default/lwc/atomIconButton/atomIconButton.html
Module not found: Error: Can't resolve 'lightning/icon' in 'C:\vrmobility\work\valueRetailDev\force-app\main\default\lwc\atomIconButton'
Have you ever tried to put an LWC component in a separate project? That is, having a component dependency.
@jserra91 I was able to resolve dependencies by adding them as aliases in lwc.config.json. It's a more manual process than preferred, but it's a solution.
I created a custom component that contains a lightning component.
<template> <button type="button" class="slds-button slds-button_icon atom-icon-button"> <template if:true={iconLeft}> <lightning-icon icon-name={iconLeft} alternative-text={iiconAlternativeText} title={iiconTitle} size={iiconSize}> </lightning-icon> </template> <span class="slds-assistive-text"></span> <template if:true={iconRight}> <lightning-icon icon-name={iconRight} alternative-text={iiconAlternativeText} title={iiconTitle} size={iiconSize}> </lightning-icon> </template> </button> </template>
When I implement the storybook for this component
import { storiesOf } from '@storybook/html';
import AtomIconButton from './atomIconButton';
import buildAndRegisterCustomElement from '../../utils/build-custom-element';
buildAndRegisterCustomElement('c-atom-icon-button', AtomIconButton);
The console return this error
ERROR in ./force-app/main/default/lwc/atomIconButton/atomIconButton.html
Module not found: Error: Can't resolve 'lightning/icon' in 'C:\vrmobility\work\valueRetailDev\force-app\main\default\lwc\atomIconButton'
Have you ever tried to put an LWC component in a separate project? That is, having a component dependency.
@reiniergs @dianawidjaja
The text was updated successfully, but these errors were encountered: