Invalid string length RangeError in Vue only certain enviroments Invalid string length RangeError in Vue only certain enviroments wordpress wordpress

Invalid string length RangeError in Vue only certain enviroments


The error is misleading. I had a similar issue and found that it's a problem with the inline template. There was a style tag, which was causing the issue in my project. In your case, I think the problem is in the data object. Use string literal in your events data object like this and it should work:

data: {            events: `<?php echo json_encode($another); ?>`,    },


This error was described and solved here: https://github.com/vuejs/vue/issues/9504

Error in the template generates error in JS due to bug in generateCodeFrame() or repeat$1() (may be fixed in in one way or another).


Another case

In my case, this error was caused because I repeat the same HTML attribute

<div class="awesome wow"     class="anotherawesome"></div>

This will raise the same issue.

Solution

<div class="awesome wow anotherawesome"></div>