xvrh / atlassian_apis

https://pub.dev/packages/atlassian_apis
MIT License
8 stars 7 forks source link

can't use #6

Open AnOnionz opened 3 years ago

AnOnionz commented 3 years ago

I received this error: Error: XMLHttpRequest error. C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 906:28 get current packages/http/src/browser_client.dart 71:22 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1612:54 runUnary C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 152:18 handleValue C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 704:44 handleValueCallback C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 733:13 _propagateToListeners C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 530:7 [_complete] C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream_pipe.dart 61:11 _cancelAndValue C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream.dart 1219:7 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14 _checkAndCall C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39 dcall C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/html/dart2js/html_dart2js.dart 37307:58

at Object.createErrorWithStack (http://localhost:61157/dart_sdk.js:5347:12)
at Object._rethrow (http://localhost:61157/dart_sdk.js:39349:16)
at async._AsyncCallbackEntry.new.callback (http://localhost:61157/dart_sdk.js:39343:13)
at Object._microtaskLoop (http://localhost:61157/dart_sdk.js:39175:13)
at _startMicrotaskLoop (http://localhost:61157/dart_sdk.js:39181:13)
at http://localhost:61157/dart_sdk.js:34688:9
xvrh commented 3 years ago

It seems you are trying to run it on the Web platform and hitting a CORS issue (https://en.wikipedia.org/wiki/Cross-origin_resource_sharing). I've never tried on the web and I'm not sure how it is suppose to work. I can only see this small information when using OAuth2: https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/#is-cors-whitelisting-supported-

pablobarrera commented 2 years ago

Hi, in this post it seems this error can be solved by using OAuth 2.0 (3LO): https://community.developer.atlassian.com/t/cors-error-with-rest-api/27354/6