Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async await syntax is broken on Firefox #5124

Open
sinhgc opened this issue Jan 10, 2025 · 2 comments
Open

Async await syntax is broken on Firefox #5124

sinhgc opened this issue Jan 10, 2025 · 2 comments
Labels
External: Other Salesforce Categorizes issue or PR as related to Salesforce related features.

Comments

@sinhgc
Copy link

sinhgc commented Jan 10, 2025

Description

The modern async - await syntax seems broken on Firefox while using a static resource library.
Please note that if I put the same code in to a LWC, it works well, but when I put it into a static resource, it's broken.

Steps to Reproduce

  • Create a simple static resource like this
const test = async () => {
    console.log('hello');
};

(async () => {
    await test();
    console.log('This line is unreachable on Firefox');
})();
  • From the LWC
import { LightningElement } from 'lwc';
import sampleLib from '@salesforce/resourceUrl/sampleLib'
import {loadScript} from 'lightning/platformResourceLoader'

export default class SampleCode extends LightningElement {
    constructor(){
        super();
        loadScript(this, sampleLib).then(()=> {
            //just do nothing
        })
    }
}

Expected Results

The line of code after the await should be reachable.

Actual Results

The line of code after the await is unreachable on Firefox.

Browsers Affected

Firefox

Version

The latest version - 134.0 (aarch64)

@wjhsf
Copy link
Contributor

wjhsf commented Jan 10, 2025

Thanks for reporting this issue! It looks like an issue with the resource loader module, not the LWC framework (this repo). To resolve your issue, I would recommend opening a Salesforce Stack Exchange question or a Salesforce case.

@wjhsf wjhsf added the External: Other Salesforce Categorizes issue or PR as related to Salesforce related features. label Jan 10, 2025
@sinhgc
Copy link
Author

sinhgc commented Jan 13, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External: Other Salesforce Categorizes issue or PR as related to Salesforce related features.
Projects
None yet
Development

No branches or pull requests

2 participants