Skip to main content

Hi,

I am developing standalone lightning web runtime single page application that created followed this steps: 

 

  1. In a terminal program, run npm init lwr@latest
  2. For Project name, enter MyProject.
  3. Accept the generated package name by pressing the Enter key.
  4. For Select a type of project, Single Page Application.

I followed basic steps of the documents to develop LWR in Visual Studio code, which is mentioned in this: https://developer.salesforce.com/docs/platform/lwr/guide/lwr-get-started.html

 

In the created LWR SPA project, I want to use LWC of this page: https://developer.salesforce.com/docs/component-library/overview/components.

 

I set my Layout.html with {{{body}}} {{{lwr_resources}}}, and in custom components, I added a lightning component for example,

<lightning-button variant="base" label="Base" title="Looks like a link" onclick={handleClick} class="slds-m-left_x-small"></lightning-button>

When I run npm run dev, the component is successfully shown on localhost webpage.

However, to make a build, I ran npm run build, then it says an error that

[error] Bad character escape sequence

Error: Bad character escape sequence

 

When I run "npm run build" without Lightning web component, there is no error, therefore I guess the errors are came from using LWC and building the component.

How can I make it correctly without errors?

1 个回答
0/9000