Skip to content

Web Support #3

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

Closed
MisterJimson opened this issue Mar 30, 2021 · 7 comments
Closed

Web Support #3

MisterJimson opened this issue Mar 30, 2021 · 7 comments

Comments

@MisterJimson
Copy link
Contributor

MisterJimson commented Mar 30, 2021

Trying to get the app to run on Flutter Web

The app launches correctly on web, but when trying to make the http request I am running into this: GoogleCloudPlatform/functions-framework-dart#201

Will follow up if I am able to resolve

@andreujuanc
Copy link

It worked for me. v2

@MisterJimson
Copy link
Contributor Author

Sorry v2 of what? And which Flutter version are you on? I wonder if it could be dependant on that.

@andreujuanc
Copy link

If you upgrade to => flutter v2 you get web for free.

@MisterJimson
Copy link
Contributor Author

Yes I can boot up the app on web fine, but when you click the button to make the http request it fails with the details I linked in the description.

@andreujuanc
Copy link

I saw there were some cors errors.
Two options to fix this:

  1. Add cors * (or appropriate host list)
  2. On web get from / and proxy that to the backend.

I guess the easiest would be just to add cors * , since this is just a demo.

@subfuzion
Copy link
Owner

Apparently, we're not handling the OPTIONS request in the Dart Functions Framework that the browser client is submitting before the POST request. Need to do a bit more investigating. cc/ @kevmoo

@subfuzion
Copy link
Owner

@MisterJimson, @andreujuanc Would you please re-open this issue at https://github.com/GoogleCloudPlatform/functions-framework-dart? This demo has now been merged there under the examples directory and this repo is being deprecated/archived. If you don't have a chance to get to it in the next day, then I'll go ahead and do it. Thanks!

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

3 participants