Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [lwc-oss]

Lightning web components OSS, referred to as Lightning web components Open Source is a framework that allows building custom elements with HTML, JavaScript, and CSS. Lightning Web Components uses standard HTML, modern JavaScript (ES6+), and the best of native Web Components and can be used to build web apps on or off (ex website hosted on Heroku/Netlify or PWA app hosted outside Salesforce) Salesforce platform.

Filter by
Sorted by
Tagged with
0 votes
1 answer
55 views

web application using open-source LWC and node.js

I'm trying to create web app using open-source LWC and node.js and following the steps mentioned in this blog. My app is working till Step 2. I'm stuck in Step 3 where I need to Create a GET method at ...
user avatar
0 votes
0 answers
32 views

This is my LWC and I want some flexibility in it

I want flexibility so that in the first row it ends with 105 and in the next row it starts with 201; it means it automatically creates a row start with initials 1,2,3 and it means if it ends with 105, ...
user avatar
0 votes
0 answers
26 views

How to over come the error :- The `innerHTML` property is available only on elements that use the `lwc:dom="manual"` directive?

On click of a div i am trying clear the content and I am making it editable. so when i try to get the innerHTML it has no issues but when i try to modify the innerHTML , i get a console error as below ...
user avatar
1 vote
0 answers
103 views

Problem while executing command npm run start on scratch LWR projects

I having an issue while running a LWR project. I am creating a scratch project using the steps shown in https://lwc.dev/ but not able to get proper output (in this case a "Hello World" text) ...
user avatar
1 vote
0 answers
36 views

How to use an lwc oss web component in a vue project for example?

I would like to import this lwc oss component: https://www.npmjs.com/package/lwc-clock-utils in a vue project. May someone help me pointing how to properly import the package?
user avatar
2 votes
1 answer
58 views

html select is not working when manipulated from js

I am currently writing an LWC OSS project and am currently confused about some reproducible side-effects on a <select>. The element can be "injected" from outside, by setting the value ...
user avatar
  • 6,120
4 votes
1 answer
83 views

LWC OSS: How to set properties of components imported dynamically?

I am trying create components dynamically with the help of lwc:dynamic directive in LWC OSS. I am able to create those comments dynamically, but not able to set the properties to them. For each ...
user avatar
  • 10.5k
0 votes
1 answer
163 views

this.querySelector || this.getElementsByClassName not working in LWC OSS

I am creating an application on LWC OSS. As Lightning Toasts are not available on LWC OSS, I am trying to create a notification component that can show the notifications. I am just trying to run the ...
user avatar
0 votes
0 answers
66 views

Not able to find index.js on Heroku [LWC OSS]

Getting the following not found error while deploying a new, non-modified version of LWC OSS. It was just a simple installation of npx create-lwc-app, and some basic steps in the package.json to make ...
user avatar
1 vote
1 answer
190 views

Not able to deploy LWC OSS app to Heroku

Getting the following error when I am trying to deploy an LWC OSS app to Heroku, I tried to deploy my app which had customizations got the same error, but now this is an LWC OSS fresh installation ...
user avatar
1 vote
2 answers
110 views

Could Not Find module "lightning/ariaObserver" LWC OSS

I am trying to implement a project with LWC OSS, when trying to import lightning-input I am facing the following error. I tried to import the lightning-button and I was able to import the same ...
user avatar
0 votes
1 answer
71 views

Edit Lighting Web Component and retrieve code

My org recently had a lighting web component written launched into production. Unfortunately, the team we outsourced this to left off a necessary field. I would like to edit this code to include this ...
user avatar
0 votes
0 answers
28 views

Unable to create LWC recipe component in the Webcomponents.dev playground

I am trying to create the LWC OSS components in the https://webcomponents.dev/. I created the hello.html with the below code. <template> <ui-card title="Hello"> <...
user avatar
0 votes
1 answer
127 views

Creating LWC OSS app using Lightning Web Runtime

Salesforce is deprecating create-lwc-app. Instead, Salesforce is suggesting to create an LWC OSS app using Lighting Web Runtime. The command to create the LWC OSS app is npm init lwr I ran npm init ...
user avatar
0 votes
0 answers
33 views

Lightning Web Component Open Source

When I try to create the project with lwc oss it comes to nothing, stops at the attached image part and does not progress. Do you know why this could be the problem?
user avatar
0 votes
0 answers
128 views

jsforce logout functionality

In one of my node project, I am using jsforce oauth2 to connect to Salesforce. This is working nicely. Below is the code I am using for logout functionality. This is also working fine without any ...
user avatar
-1 votes
1 answer
177 views

LWC Select component to select value based on specific value in JS not HMTL

I have code right now below that selects the value based on the selectedindex of 0 or since I only have two options. What I am trying to figure out is how to set the select value instead of by 0 or 1 ...
user avatar
  • 27
0 votes
1 answer
665 views

LWC Select component how to default value in JS not HTMl

I am trying to default the value of the select to a specific value based on a condition so I cannot just put selected in the html. I need JS code that will automatically update it. For this though I ...
user avatar
  • 27
1 vote
1 answer
120 views

lwc-oss lightning-base-components jest tests

I am working on an lwc-oss project and found reference to lightning-base-components npm package in a salesforce blog post. https://developer.salesforce.com/blogs/2020/12/build-connected-apps-anywhere-...
user avatar
  • 21
0 votes
0 answers
44 views

LWC OSS - Google Recaptcha - Shadow Dom

I'm working on implementing recaptcha into an LWC OSS app hosted in heroku. I've been succesful getting it to work using the following code. I am getting the error to add lwc:dom="manual" ...
user avatar
  • 21
0 votes
0 answers
41 views

LWC OSS Unit Test cases error

In one of my project, I am using lwc oss with base components. Inside the HTML files I am using lwc component like <lightning-datatable> , <lightning-button-menu> etc... along with lwc oss ...
user avatar
0 votes
1 answer
169 views

How to get value from Case.Account.Primary_Email__c and Case.ContactEmail from case recordID and autopopulated in To field on email page in lwc?

Controller_consumerSendEmail.cls public with sharing class Controller_consumerSendEmail { @AuraEnabled(cacheable=true) public static void sendEmailToController(String toSend, String subject){ ...
user avatar
0 votes
1 answer
191 views

Wrap LWC OSS App for Mobile

Is there a way to make an LWC "OSS" app obviously running on Node.js as a Mobile application? (i.e. Cordova). I see you can create an LWC Hybrid app running your "Salesforce" LWC ...
user avatar
0 votes
1 answer
1k views

Parsing JSON string value returned from APEX in LWC

I am receiving JOSN string in the following format {"data":{"meta":{"resultCode":null,"message":null},"data":[{"code":"$RFG","...
user avatar
  • 207
0 votes
2 answers
1k views

LWC : onchange Handler not getting fired when @track attribute is changed

I have two lightning input in a simple LWC component having respective onchange handlers and being @tracked with respective attributes. Second onchange handler is getting fired when I update second @...
user avatar
1 vote
1 answer
317 views

LWC Build Files Explaination

I have been trying to research this on my own, but I can't find a simple explanation that tells me the difference between the following 2 files: lwc.config.jsonhttps://developer.salesforce.com/blogs/...
user avatar
2 votes
1 answer
301 views

LWC OSS - Can I use an component I build in LWC OSS within Salesforce?

I am likely not understanding some parts of the potential of LWC OSS but is it possible to built an application/ component in LWC OSS and then utilize it within Salesforce. Or is this only for ...
user avatar
0 votes
2 answers
3k views

How to Show/Hide button based on Profile in Salesforce LWC?

I have develop LWC component which is normally used by normal users. In that lightning web component button is there as below. <lightning-button slot="actions" label="Deactivate"...
user avatar
  • 15
0 votes
1 answer
211 views

Call API from LWC OSS

I created an LWC OSS app with express server using npx create-lwc-app: Do you want to use the simple setup? Yes Package name for npm demo-app Select the type of app you want to create Standard web ...
user avatar
  • 341
1 vote
1 answer
275 views

Is it possible to use LWC-related npm modules & webpack to leverage the LWC framework with Cloudflare Workers?

I am hoping to use the LWC framework with Cloudflare Workers in JavaScript, but running into some issues. It seems like Wrangler ignores node_modules so I was hoping to use webpack in order to load ...
user avatar
2 votes
1 answer
120 views

How to Customize Base Components?

I want to use a custom icon with a button. The standard lightning-button could not be used because it does not support custom icons. So I looked into the base-components-recipes repository as the docs ...
user avatar
  • 4,645
0 votes
1 answer
221 views

How we can achieve navigation to another page in LWC OSS?

I created my first app using LWC OSS. I want to achieve the navigation from one page to another (url in the browser should change) I have two files created in LWC OSS app first file at src/client/...
user avatar
1 vote
2 answers
206 views

LWC OSS Import External Google API's

I am trying to utilize Google API's in a LWC component. I am able to do a fetch in my component to a hosted API endpoint that utilizes the google API's and returns a list of Google Drive files via ...
user avatar
2 votes
1 answer
377 views

How to configure Socket.io to work with LWC OSS?

I am trying to use socket.io library with LWC OSS and followed the below steps: Created LWC OSS app using the command npx create-lwc-app my-app Installed socket.io library using the command npm ...
user avatar
  • 8,312
3 votes
1 answer
112 views

In LWC OSS what is this.allsession while assigning to arrya

I am learning LWC OSS and in the trailhead, I am unable to understand, the use of this.allSessions in the below code while assigning the result to the array variable of "sessions = []" ...
user avatar
2 votes
1 answer
209 views

Unable to use lwc:dynamic directive in LWC component

How do I enable the lwc:dynamic directive or is it tied to certain release of Salesforce?
user avatar
0 votes
1 answer
71 views

LWC OSS Build Command

I'm trying to build an LWC OSS project for production, but I can't figure out where the 'npm run build' command builds the bundled resource. I don't see anything obvious in the configs or on either of ...
user avatar
6 votes
1 answer
1k views

Lightning Open source use of base components

A few days back an npm package for base lightning components was released Base Lightning Components With this I am expecting to use base lightning components like my favorite lightning-datatable in a ...
user avatar
0 votes
1 answer
188 views

Query Selector is not working when I am putting inside renderedCallback Lifecycle hook in Lightning Web Component

I am creating a variable crashride and doing querySelector inside renderedcallback then I am using that variable inside another function. But if I directly say this.crashride inside the function ...
user avatar
0 votes
0 answers
673 views

JSForce GET Request Issue

I am using a LWC Open source app to make a GET request to my Salesforce Org. I want to get the resource at : https://na111.salesforce.com/services/data/v42.0/sobjects/EventLogFile/0AT3h00000PE85uGAD/...
user avatar
0 votes
0 answers
112 views

new XSLTProcessor() fails in lwc

I am playing around a bit with lwc and the open-source version of it. I tried to copy my open source lwc component into my saleforce project but now I am getting an error message that does not really ...
user avatar
  • 6,120
5 votes
2 answers
5k views

LWC datatable Header wrapping

I am working on a LWC component where in a lightning datatable I have more than 7-8 columns. When I add the component into detail section of a record page, the headers of the table is getting ...
user avatar
2 votes
1 answer
370 views

LWC OSS cannot find ui-card component

I am looking at the open source LWC recipes and whenever I try to add a template to app.html which references ui-card, I am hitting a compile error. I saw that this issue has come up before from ...
user avatar
6 votes
1 answer
591 views

Inconsistencies between shadow DOM and synthetic DOM on LWC OSS

We've been working on porting our LWC components from platform into LWC OSS. In order to do this, we have a copy of SLDS classes we have created and we need them to be applied globally. For us it will ...
user avatar
3 votes
1 answer
363 views

OSS LWC app on Heroku Css Fails to load

I am trying to run an OSS LWC app on heroku using SLDS via synthetic shadow dom. When I run it locally using heroku local web everything looks great. When it makes all the way to my Heroku site, I ...
user avatar
  • 1,345
3 votes
0 answers
263 views

Adding Service Worker to LWC

How do we add a service worker to an LWC local application? I am trying to add a service worker to an LWC application. I have added the sw.js to the project but it shows an error while registering ...
user avatar
4 votes
1 answer
2k views

Normalizing Boolean values in LWC

Looking at LWC e-bikes sample gallery, I found these comments in code regaring normalizing values. Can someone refer to what they have meant or how to do this normalization using best practices? ...
user avatar
  • 1,828
9 votes
3 answers
3k views

lightning-input firing two onclick events in Lightning Web Component

I am receiving two events when I am clicking lightning-input checkbox. This behavior is the same in Salesforce as well as on the LWC playground. Wherever if use html checkbox then I receive event ...
user avatar
2 votes
1 answer
293 views

routing or dynamic creation of LWC Open Source components to avoid multiple IF conditions

we are working on LWC Open Source and to navigate to the new component, currently we are using if:true with a boolean value which is not appropriate for a long run. Is there any other way to achieve ...
user avatar
6 votes
1 answer
782 views

Lightning Web Components - Custom Decorator support

Part 1 - Custom decorators blocked in LWC I'm trying to implement a custom decorator, very simple book example but getting LWC error in both LWC open source and LWC for salesforce, LWC1100: Invalid ...
user avatar
  • 1,603