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

Return Value Out of Scope All of a Sudden? #274

Open
VikR1000 opened this issue May 11, 2024 · 0 comments
Open

Return Value Out of Scope All of a Sudden? #274

VikR1000 opened this issue May 11, 2024 · 0 comments

Comments

@VikR1000
Copy link

This code, provided in the docs, has worked fine for years:

ics.createEvent(event, (error, value) => {
  if (error) {
    console.log(error)
    return
  }

  return value;
  

Then all of a sudden today I was getting errors on the line return value;, that value was null. I figured it was an out-of-scope error. Updating it to this fixed it:

    let icsString = ''
    ics.createEvent(iCalEvent, (error, value) => {
        icsString = value;
        if (error) {
            console.log('ics error: ', error);
            return
        }
    })
    return icsString;

But... it worked for years. Why did it need an update today?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant