{"action":"reopened","issue":{"url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/690","repository_url":"https://api.github.com/repos/metafizzy/infinite-scroll","labels_url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/690/labels{/name}","comments_url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/690/comments","events_url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/690/events","html_url":"https://github.com/metafizzy/infinite-scroll/issues/690","id":243277956,"number":690,"title":"404 request before last page check with prefill","user":{"login":"Einkoro","id":1577833,"avatar_url":"https://avatars2.githubusercontent.com/u/1577833?v=4","gravatar_id":"","url":"https://api.github.com/users/Einkoro","html_url":"https://github.com/Einkoro","followers_url":"https://api.github.com/users/Einkoro/followers","following_url":"https://api.github.com/users/Einkoro/following{/other_user}","gists_url":"https://api.github.com/users/Einkoro/gists{/gist_id}","starred_url":"https://api.github.com/users/Einkoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Einkoro/subscriptions","organizations_url":"https://api.github.com/users/Einkoro/orgs","repos_url":"https://api.github.com/users/Einkoro/repos","events_url":"https://api.github.com/users/Einkoro/events{/privacy}","received_events_url":"https://api.github.com/users/Einkoro/received_events","type":"User","site_admin":false},"labels":[{"id":69815,"url":"https://api.github.com/repos/metafizzy/infinite-scroll/labels/bug","name":"bug","color":"e10c02","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-07-17T00:36:52Z","updated_at":"2017-09-08T18:26:01Z","closed_at":null,"author_association":"NONE","body":"When you use the `prefill` option it will 404 trying to grab a page that doesn't exist before the last check fires. I encountered this working with WordPress & WooCommerce but have created a minimal test case linked below.\r\n\r\n```\r\n[InfiniteScroll] pageIndex. current page determined to be: 1 from next link\r\n[InfiniteScroll] initialized. on products\r\n[InfiniteScroll] prefill\r\n[InfiniteScroll] request. URL: /shop/page/2/\r\nXHR finished loading: GET \"https://shopmmcurate.com.dev/shop/page/2/\".\r\n[InfiniteScroll] scrollThreshold\r\n[InfiniteScroll] load. Products – Page 2 – Shop MMCurate. URL: /shop/page/2/\r\n[InfiniteScroll] append. 2 items. URL: /shop/page/2/\r\n[InfiniteScroll] prefill\r\n[InfiniteScroll] request. URL: /shop/page/3/\r\n[InfiniteScroll] last. URL: /shop/page/2/\r\nGET https://shopmmcurate.com.dev/shop/page/3/ 404 ()\r\n[InfiniteScroll] error. Error. URL: /shop/page/3/\r\nXHR failed loading: GET \"https://shopmmcurate.com.dev/shop/page/3/\".\r\n```\r\n\r\n```\r\n$( '.archive .products' ).infiniteScroll( {\r\n    path: '.page-numbers .next',\r\n    append: '.product',\r\n    prefill: true,\r\n    debug: true\r\n} );\r\n```\r\n\r\nTest case: http://mmcurate.com/test/test-case.html\r\n"}}
{"actor":{"display_login":"desandro"}}