GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-dart

XMLHttpRequest Error when running with Flutter Web

Open
#201 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Dart
Stars
548
Forks
49
Avg merge
53m
Merged PRs (30d)
1

Description

I've setup this project https://github.com/subfuzion/dart-flutter-fullstack-demo

Works great with macOS desktop, running the backend locally and on Google Cloud Run.

When I try with Flutter Web, both local and on Google Cloud I get error when making the request.

**Google Cloud**
Client error: `XMLHttpRequest error`

**Local**
Client error: `XMLHttpRequest error`
Backend error:
```
2021-03-30T09:27:16.234904 0:00:00.003117 OPTIONS [400] /
[BAD REQUEST] OPTIONS /
Content-Type header is required. (400)
dart:isolate _RawReceivePortImpl._handleMessage
```

Flutter Doctor
```
[✓] Flutter (Channel beta, 2.1.0-12.2.pre, on Mac OS X 10.15.7 19H524 darwin-x64, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.3)
[✓] VS Code (version 1.54.3)
[✓] Connected device (4 available)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.