Skip to content

Commit

Permalink
fix(cli): analytics error (#4550)
Browse files Browse the repository at this point in the history
Calling `await` at the top level isn't supported in Node.js, so the code in `detached-export.ts` (which is run in a child process) was silently failing. Reverting to the previous behavior (not using `await`) resolves the issue.

Fixes #4546

## Checklist

- [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted)
- [x] Description explains motivation and solution
- [ ] Tests added (always)
- [ ] Docs updated (only required for features)
- [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
  • Loading branch information
Chriscbr authored Oct 16, 2023
1 parent d61083e commit d28bc48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/wing/src/analytics/scripts/detached-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function reportAnalytic() {
fs.unlinkSync(filePath);
}

await (async () => {
void (async () => {
try {
await reportAnalytic();
} catch (err: any) {
Expand Down

0 comments on commit d28bc48

Please sign in to comment.