vivaxy / alfred-open-in-vscode

Alfred workflow to open in VSCode
GNU General Public License v3.0
36 stars 4 forks source link

Error searching in WDS directory #12

Open fSergio101 opened 3 years ago

fSergio101 commented 3 years ago

How to reproduce

[03:26:56.709] ERROR: Open in VSCode[Script Filter] JSON error: Garbage at end. in JSON:
{
    "items": []
}
{
    "items": [
        {
            "title": "TypeError: (intermediate value).flat is not a function\n    at getWds (/usr/local/lib/node_modules/alfred-open-in-vscode/index.js:23:5)\n    at process._tickCallback (internal/process/next_tick.js:68:7)",
            "subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
            "valid": false,
            "text": {
                "copy": "```\nTypeError: (intermediate value).flat is not a function\n    at getWds (/usr/local/lib/node_modules/alfred-open-in-vscode/index.js:23:5)\n```\n\n-\nOpen in VSCode 1.1.0\nAlfred 4.3.4\ndarwin 20.5.0",
                "largetype": "TypeError: (intermediate value).flat is not a function\n    at getWds (/usr/local/lib/node_modules/alfred-open-in-vscode/index.js:23:5)"
            },
            "icon": {
                "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
            }
        }
    ]
}

Expected result

Could latest commit that implemented getWds function be the reason of the bug?

vivaxy commented 3 years ago

getWds works fine on Node.js v12. What's your Node.js version?

fSergio101 commented 3 years ago

v12.22.3 I'm using nvm I'm not familiar with node, so consider it could be an issue of my local environment. Feel free to close the issue if it works 😉

vivaxy commented 3 years ago

Hi, @fSergio101. I'd like to make sure the correct version of Node.js is used. Could you please check node version with > nvm ls default?

fSergio101 commented 3 years ago
> nvm ls default
       v14.17.3
fSergio101 commented 3 years ago

changing the default as follows

> nvm alias default 12.22.3
default -> 12.22.3 (-> v12.22.3)
> nvm ls default
->     v12.22.3

it still happens anyway

vivaxy commented 3 years ago

@fSergio101 Hi, could you install the latest alfred-open-in-vscode@1.3.1, and type code DEBUG to see which node version is running?