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

[Windows] Extension installation fails, quoting "fetch undefined". #397

Closed
eikopf opened this issue Apr 11, 2024 · 9 comments
Closed

[Windows] Extension installation fails, quoting "fetch undefined". #397

eikopf opened this issue Apr 11, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@eikopf
Copy link

eikopf commented Apr 11, 2024

After installing the extension, and when opening a folder containing only an empty file called Main.flix, VSCode produces a vague error about fetch being undefined.

Cannot install extension: fetch is not defined.

At least for me, the solution was to run npm install --global node-fetch and then completely restart VSCode. Is there a way to use a function from node-core, or is this a VSCode-on-Windows issue?

@magnus-madsen magnus-madsen added the bug Something isn't working label Apr 14, 2024
@magnus-madsen
Copy link
Member

Hi @eikopf and thanks for the bug report.

(I have been away, hence the long response).

What version of VSCode were you using? Newer version come with fetch built-in so there should not be any issue.

It should just "work out of the box".

@magnus-madsen
Copy link
Member

Can you offer some more details? VSCode Version? Windows version?

(We have multiple machines with Windows where it works currently, so any extra information would be useful).

@sockmaster27 Do you have any ideas other than outdated VSCode?

@magnus-madsen
Copy link
Member

@eikopf
Copy link
Author

eikopf commented Apr 14, 2024

Can you offer some more details? VSCode Version? Windows version?

(We have multiple machines with Windows where it works currently, so any extra information would be useful).

@sockmaster27 Do you have any ideas other than outdated VSCode?

This was on VSCode 1.88.0 and Windows 22H2 (specifically build 22621.3447). I checked to see if I was wildly behind on VSCode versions, but installing the updates available only gave me 1.88.1.

It's entirely possible that I happened to be on an older version of VSCode when I installed the Flix extension, and that restarting it just happened to also apply the update that included node-fetch in VSCode's version of node. Admittedly, I can't reproduce the bug (even by uninstalling node-fetch with npm), so my suspicion is that that's what happened.

@eikopf
Copy link
Author

eikopf commented Apr 14, 2024

I'd suggest that if your Windows machines don't have this issue, then it's probably enough to call this expected behaviour for using an out-of-date version of VSCode.

@magnus-madsen
Copy link
Member

I'd suggest that if your Windows machines don't have this issue, then it's probably enough to call this expected behaviour for using an out-of-date version of VSCode.

I strongly suspect this to be the case.

@sockmaster27
Copy link
Contributor

I agree. The newer releases of the extension should declare the minimum supported VS Code version correctly.
What might have happened is that VS Code grabbed an older release that (incorrectly) claimed to support its version.
Perhaps we should just yank all releases except the newest?

@sockmaster27
Copy link
Contributor

@magnus-madsen Is this possible?

@magnus-madsen
Copy link
Member

@magnus-madsen Is this possible?

Not sure, but I would rather not mess with it.

As I see it, this problem disappears with time and we can leave this ticket as documentation, if someone else should have the same problem.

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

No branches or pull requests

3 participants