infinite-scroll: Tumblr - Uncaught DOMException: Failed to set the 'responseType' property on 'XMLHttpRequest'

First, thanks for keeping infinite-scroll alive and updating it new heights

I have old v2 code which I tried to update to new v3 API and in some ways not sure how to completely change as it uses old Infinite Scroll, ImageLoaded, Isotope and callback function to launch fancyBox too:

$(function() {
   var $container = $('.main-content');
   $container.imagesLoaded({
       background: true
   }, function() {
       $container.isotope({
           itemSelector: '.post-article',
           layoutMode: 'masonry',
           transitionDuration: '1s'
       });
   });
   $container.infinitescroll({
           itemSelector: ".post-article",
           navSelector: "#pagination",
           nextSelector: "#pagination #next-page a",
           loading: {
               finished: undefined,
               finishedMsg: "",
               msg: null,
               msgText:"",
               selector: null,
               speed: 'fast',
               start: undefined
           },
           bufferPx: 5500,
           prefill:true,
           debug: true,
           animate:false
       },
       // trigger Masonry as a callback
       function(newElements) {
           var $newElems = $(newElements).css({
               opacity: 0
           });
           // ensure that images load before adding to masonry/isotope layout
           $newElems.imagesLoaded(function() {
               $newElems.animate({
                   opacity: 1
               });
               $container.isotope('appended', $newElems);
               $newElems.each(function()
               {
                   $(this).find(".image-thumbnail a").each(openFancyBox);
               });
               
           });
       }
   );
});

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (12 by maintainers)

Most upvoted comments

Thanks for that. This bug is occurring because the XMLHttpRequest has been set to syncronous for some reason. I don’t know why just yet. I see that Tumblr actually modifies XMLHttpRequest which is weird. I’ll continue to investigate.

I seem to have fixed the issue by specifically adding true attribute to

 function request( url, responseType, onLoad, onError ) {
  var req = new XMLHttpRequest();
  req.open( 'GET', url, true );

as in #705

v3.0.2 has been released with this PR merged. Please update! Thank you again to @shinoamakusa for the contribution and saving my day 🌈 🐻

@shinoamakusa Thanks for digging into this. Your fix has been merged and will be out in the next release.

That gives me the following error in Developer Console:

infinite-scroll.pkgd.min.js:12 Uncaught DOMException: Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be changed for synchronous requests made from a document.
    at r (https://unpkg.com/infinite-scroll@3.0.0/dist/infinite-scroll.pkgd.min.js:12:9886)
    at n.s.loadNextPage (https://unpkg.com/infinite-scroll@3.0.0/dist/infinite-scroll.pkgd.min.js:12:10636)
    at n.s.onScrollThresholdLoad (https://unpkg.com/infinite-scroll@3.0.0/dist/infinite-scroll.pkgd.min.js:12:10414)
    at n.e.emitEvent (https://unpkg.com/infinite-scroll@3.0.0/dist/infinite-scroll.pkgd.min.js:12:1952)
    at n.s.dispatchEvent (https://unpkg.com/infinite-scroll@3.0.0/dist/infinite-scroll.pkgd.min.js:12:5963)
    at n.<anonymous> (https://unpkg.com/infinite-scroll@3.0.0/dist/infinite-scroll.pkgd.min.js:12:13942)
    at n.<anonymous> (https://unpkg.com/infinite-scroll@3.0.0/dist/infinite-scroll.pkgd.min.js:12:8917)
    at n.onPageScroll (https://unpkg.com/infinite-scroll@3.0.0/dist/infinite-scroll.pkgd.min.js:12:8988)

Live url is http://jai-envie-de-toi.ml/ (be aware that it contains sensitive adult content aka nudity)