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

Getting exception when using iron-ajax for sync request. #293

Open
6 tasks
anotherapj opened this issue Aug 22, 2017 · 0 comments
Open
6 tasks

Getting exception when using iron-ajax for sync request. #293

anotherapj opened this issue Aug 22, 2017 · 0 comments

Comments

@anotherapj
Copy link

anotherapj commented Aug 22, 2017

Description

The iron-ajax element is throwing script exception for sync request.

Expected outcome

The iron-ajax should complete the sync request and return the request object with response data.

Actual outcome

Getting the below exception
InvalidAccessError: A parameter or an operation is not supported by the underlying object

Live Demo

NA

Steps to reproduce

1, Create iron-ajax element.
2, Set the sync property.
3, call the generateRequest() method.
Below is the code(slightly modified version from app-localize-behavior)
`var ajax = proto.__localizationCache.ajax;
if (!ajax) {
ajax = proto.__localizationCache.ajax = document.createElement('iron-ajax');
ajax.sync = true;
}

var request = proto.__localizationCache.requests[path];
if (!request) {
    ajax.url=path;
    ajax.method= "POST";
    ajax.headers = { "Content-Type":"application/json"};
    ajax.body = this.getRequestBody();
    ajax.handleAs = "json";        
    request = ajax.generateRequest();`

The failure is happening on iron-request.html file @ send method, trying to set
xhr.withCredentials = !!options.withCredentials;
If I remove the above line, the request works fine.

Browsers Affected

  • [ y] Chrome
  • [ y] Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10
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

1 participant