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

generateImages() function does not return a Promise #995

Open
jetxr opened this issue Mar 31, 2023 · 1 comment
Open

generateImages() function does not return a Promise #995

jetxr opened this issue Mar 31, 2023 · 1 comment
Labels
bug Something isn't working needs verification Bug needs to be verified with reproduction

Comments

@jetxr
Copy link

jetxr commented Mar 31, 2023

Describe the bug
generateImages() function is async and type hints that it will return a Promise but does not return a Promise.

return {
savedImages,
htmlMeta,
manifestJsonContent,
};
}

Expected behavior
generateImages() should return a Promise that gets resolved with the value of type Result.

Why

  • While using await generateImages in a CD environment, I cannot do process.exit() as shown in the examples.
  • Current implementation causes the following example to just wait without exiting gracefully
import {generateImages} from "pwa-asset-generator";

await generateImages('input.svg', './output', {
    type: 'png',
});

await generateImages('input.svg', './output', {
    type: 'jpg',
});

System (please complete the following information):

  • OS: macOS Ventura
  • node version: 18.4
  • npm version: 9.3.1
  • cli version: 6.2.1

Additional context
Thankully Github Actions terminated the script after 6 hours :)

@jetxr jetxr added bug Something isn't working needs verification Bug needs to be verified with reproduction labels Mar 31, 2023
@atjn
Copy link
Collaborator

atjn commented Aug 24, 2024

I am not able to reproduce this. The provided file runs fine and awaits each function call, then exits the process.

With that said, the output code uses an old promise shim to return the promise, and it is possible that this is incompatible with whatever setup you have. We can leave this open until a new version is released that uses native promises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs verification Bug needs to be verified with reproduction
Projects
None yet
Development

No branches or pull requests

2 participants