ts1/flipbook-vue

RangeError: Maximum call stack size exceeded

ciprian-morar opened this issue · 4 comments

Hello,

I'm trying to add your component and Maximum call stack size exceeded is raised

In the array of urls I've tried:

[0: "http://localhost:8080/dam/jcr:230baad3-2047-4955-9a30-83428c163b88/100113.jpg"]
[0: null, 1: "http://localhost:8080/dam/jcr:230baad3-2047-4955-9a30-83428c163b88/100113.jpg"]
[0: "dam/jcr:230baad3-2047-4955-9a30-83428c163b88/100113.jpg"]
[0: null, 1: "dam/jcr:230baad3-2047-4955-9a30-83428c163b88/100113.jpg"]
[0: "/dam/jcr:230baad3-2047-4955-9a30-83428c163b88/100113.jpg"]
[0: null, 1: "/dam/jcr:230baad3-2047-4955-9a30-83428c163b88/100113.jpg"]

Can you help me with this please?

`

Flipbook
<script> // import Flipbook from 'flipbook-vue'; // components: { Flipbook }, export default { name: "Flipbook", props: ["height", "allowDownload", "previewImage", "flipbook", "carousel"], data() { return { pages: [], } }, created() { // console.log("inside directive") // console.log(this.carousel); // if(this.height && !isNaN(this.height) && !isNaN(parseFloat(this.height))) { // this.swiperHeight = this.height + "px"; // } if(this.flipbook) { for(let item of this.flipbook) { console.log(item) let link = window.location.origin + item.image['@link']+ ".jpg" console.log(link) this.pages.push(link); } console.log(this.pages) } }, }; </script> <style> .flipbook { width: 90vw; height: 90vh; } </style>`

ts1 commented

Can you show me the stack trace?

ts1 commented

Hmm... that information is not enough to figure out what is happening.
BTW, your code is trying to append URLs to pages dynamically, probably while Flipbook is running.
Unfortunately, Flipbook does not expect the pages prop to be changed dynamically.
Maybe this problem can be resolved by moving pages from data to computed and move the for loop to that computed, so that Flipbook sees immutable pages.

Thank you, Takeshi. It worked.