google-sheets-blog-cms icon indicating copy to clipboard operation
google-sheets-blog-cms copied to clipboard

Error with Google Script

Open blakeathomas opened this issue 7 years ago • 1 comments

Hey, Love the script! When I try to run it Google gives me the error of

TypeError: Cannot call method "slice" of undefined. (line 60, file"Code")

Lines 59 - 60 function paginate(posts, page) { var postsCopy = posts.slice(); var postsChunked = []; var postsPaginated = { posts: [], pages: { previous: null, next: null } };

If you could help me out that would be great.

blakeathomas avatar Mar 08 '18 01:03 blakeathomas

I had this issue until I published the Sheet. You must make it public using the "Share" button, but also from the File menu: "Publish to the web..."

iPaulPro avatar Mar 21 '19 18:03 iPaulPro