1

I have placed a File-Upload component, on my LWC, onto a Community page. I keep getting a Javascript error when I try and test it in preview mode. The error is "l.createComponent is not a function". I have selected the "Allow site guest users to upload files" in settings and have also tested the LWC on a Lightning Record Page and it works, so this is a Community problem.

Any ideas on why this is not working?

Thanks

enter image description here

7
  • Can you please edit the question to add a skeleton of your LWC code with specific code snippets showing where l.createComponent is used or where you use the file upload component otherwise? As it stands there likely isn't enough information to let someone answer you.
    – Phil W
    Dec 7, 2021 at 15:08
  • @PhilW l.createComponent is part of the LWC runtime, so not something the developer can, or should, call directly. I do agree that code is necessary to resolve this, though.
    – sfdcfox
    Dec 7, 2021 at 15:18
  • So, it's just the standard file-upload LWC. There is not JS. <lightning-file-upload label="test" name="Tester"> </lightning-file-upload>
    – aksnys
    Dec 7, 2021 at 15:24
  • @sfdcfox I suspected, hence the "or where you use the file upload component otherwise"...
    – Phil W
    Dec 7, 2021 at 15:32
  • 1
    @aksnys please edit the question to add more detail, including code snippets for any of your code that appears in the error stack trace (and the stack trace itself, perhaps). Showing the template for your LWC would be helpful too.
    – Phil W
    Dec 7, 2021 at 15:34

1 Answer 1

2

It sounds like you are using a LWR (Lightning Web Runtime) Template for your community.

If so, the lightning-file-upload component is not currently (as of Winter 22 release) supported.

See LWR documentation's considerations here: https://developer.salesforce.com/docs/atlas.en-us.232.0.exp_cloud_lwr.meta/exp_cloud_lwr/get_started_comp_limitations.htm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .