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

Fetch node doesn't respect "raw" checkbox #2411

Open
dcblack-google opened this issue Jul 3, 2024 · 7 comments
Open

Fetch node doesn't respect "raw" checkbox #2411

dcblack-google opened this issue Jul 3, 2024 · 7 comments
Assignees

Comments

@dcblack-google
Copy link

The fetch node doesn't seem to respect the "raw" checkbox and always tries to parse what it gets as JSON. I'm trying to use it to just grab a vanilla webpage's html and it's spitting out "Internal Exception: SyntaxError: Unexpected token '<', " <hea"... is not valid JSON }" even with raw checked.

@paullewis
Copy link
Contributor

I'm not all that clear about this one; I think @dglazkov will have a view on it, though.

@dglazkov
Copy link
Collaborator

dglazkov commented Jul 5, 2024

This should totally "just work", as of three weeks ago or so. I wonder if googleplex visual editor is running an older version?

@dcblack-google
Copy link
Author

Now that I try again from scratch I'm getting an internal exception, both on googleplex and on the external site:
Internal Exception: TypeError: Failed to fetch at _.invoke (https://breadboard-ai.googleplex.com/index-DO-MixRG.js:1567:21) at _.invoke (https://breadboard-ai.googleplex.com/define-ciGEp0Q7.js:308:24) at https://breadboard-ai.googleplex.com/path-registry-C9U4iGRp.js:15:5 at new Promise () at yt (https://breadboard-ai.googleplex.com/path-registry-C9U4iGRp.js:14:10) at gt. (https://breadboard-ai.googleplex.com/stream-DWT2qJoc.js:1277:15) }

very simple example board:
testboard.json

@dglazkov
Copy link
Collaborator

Yup, can reproduce. The error is hidden away in DevTools:

index-BQSQ4KEq.js:1567 Mixed Content: The page at 'https://breadboard-ai.web.app/?board=idb%3A%2F%2Fdefault%2Fblank-board-2.bgl.json' was loaded over HTTPS, but requested an insecure resource 'http://motherfuckingwebsite.com/'. This request has been blocked; the content must be served over HTTPS.

If I change the URL protocol to https, I get another error:

Access to fetch at 'https://motherfuckingwebsite.com/' from origin 'https://breadboard-ai.web.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Good bug! We need to add a bit more graceful error handling to fetch, so that the user doesn't have to dig into DevTools to find the actual error.

@dcblack-google
Copy link
Author

... it's respecting CORS? Gosh. Well, good to know - guess I need to come up with a completely different plan for how to fetch web content.

@dcblack-google
Copy link
Author

That was the very first thing I tried, and then swiftly abandoned when it immediately started spitting out quota exceeded errors. (I was only calling it a couple times so it wasn't me.)

Currently have an internal solution half-built, hope to get it up and running next week, but getting arbitrary web content feels like a base capability that should be better supported by the platform.

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