Skip to content

Async await syntax is broken on Firefox #5124

Open
@sinhgc

Description

@sinhgc

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    External: Other SalesforceCategorizes issue or PR as related to Salesforce related features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions