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

error fetch #1

Closed
Velass opened this issue Dec 20, 2024 · 6 comments
Closed

error fetch #1

Velass opened this issue Dec 20, 2024 · 6 comments

Comments

@Velass
Copy link

Velass commented Dec 20, 2024

hi

I'm testing your addon which interests me a lot.
but I have an error as you see below
const response = await fetch(apiUrl);
ReferenceError: fetch is not defined

I think I found the error
it's because the base node doesn't take fetch
I solved your problem by installing node-fetch with
npm install node-fetch
and adding to line 10 in main.js:
import fetch from 'node-fetch';
with this node understands fetch
I'll create a bug-fetch branch and push you the code
thanks for your work on this addon!

image

image

now with my change

image

@Velass
Copy link
Author

Velass commented Dec 20, 2024

acces denied for push the branch (its normal i dont have authorize :) )

image

@pivotiiii
Copy link
Owner

You need node v18 or newer. I assumed people usually install node from the FlowLauncher settings. I‘d prefer to not import another node-module to support older versions because some other modules also require v18, but I‘ll add a version check and appropriate error message.

@Velass
Copy link
Author

Velass commented Dec 20, 2024

ok but by default flow launcher seems to use the v16 on my side I have the 20.15 install but yet flow uses the v16.18.0

:/
image

image

@pivotiiii
Copy link
Owner

Oh wow I just checked that and Flow Launcher uses a version old enough to have reached EOL by default. Somebody already filed a bug report for that here. I will still look into adding node-fetch sometime after christmas :)

@Velass
Copy link
Author

Velass commented Dec 20, 2024

Thx dude !
very good addon other than that
thanks for your work
don't hesitate to call me if I can help you :)
happy Christmas in advance i'll let you close the when you have done

@pivotiiii
Copy link
Owner

This should be fixed in the latest version, which will be available in the Plugin Store shortly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants