Any time any console logs are attempted, it crashes the execution context.
Here is minimum reproducable code:
import alfy from "alfy";
const data = await alfy.fetch("https://jsonplaceholder.typicode.com/posts");
// alfy.log("DATA", data);
// alfy.log("HELLO");
const items = alfy
.inputMatches(data, "title")
.map((el) => ({ title: el.title, subtitle: el.subtitle, arg: el.id }));
alfy.output(items);
Uncomment any console log line and I am getting this crash
[18:37:21.238] TEST_WF[Script Filter] Queuing argument 'r'
[18:37:21.648] TEST_WF[Script Filter] Script with argv 'r' finished
[18:37:21.651] TEST_WF[Script Filter] {
"items": [
{
"title": "HELLO\n",
"subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
"valid": false,
"text": {
"copy": "```\nHELLO\n```\n\n-\nTEST_WF undefined\nAlfred 5.0\ndarwin 21.6.0",
"largetype": "HELLO"
},
"icon": {
"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
}
}
]
}
{
"items": [
{
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"arg": 1
},
{
"title": "ea molestias quasi exercitationem repellat qui ipsa sit aut",
"arg": 3
},
...shortened
]
}
[18:37:21.659] ERROR: TEST_WF[Script Filter] JSON error: Garbage at end around line 17, column 0. in JSON:
{
"items": [
{
"title": "HELLO\n",
"subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
"valid": false,
"text": {
"copy": "```\nHELLO\n```\n\n-\nTEST_WF undefined\nAlfred 5.0\ndarwin 21.6.0",
"largetype": "HELLO"
},
"icon": {
"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
}
}
]
}
{
"items": [
{
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"arg": 1
},
...shortened
]
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too