Subscribe on changes!

JS string.substring is working but Vue log an error

avatar
Oct 26th 2022

Vue version

3.2.41

Link to minimal reproduction

https://sfc.vuejs.org/#eNptUtuOgjAQ/ZVJX9BEQFn3hmCy32F9QChujbRNW1w3hH/faWENIU5IZoZz5taZjnwpFd1aRlKSmVJzZcEw26o9FbxRUlvoQLMaeqi1bCBAakAFZPFARhoVmWWNuhaWoQeQGVUIuIW11DklipcMuIBSVowSR7fUAnSdA/reBWDISQ+hsYtFM4snKdGdFGN331XF6qK92s6FlbJRrWVV6r1BXL3FcvLDyZVZD0AOwSZ52b6+vX98rjdJsHvOK7QufpF8OD4hcFGxO4KbZAbi4LDwDEQT2AHf52unwhDmHT169aUO/Ighzo1MezJWc3Fe+DrhduX1clbLy9BJmMN2ho7P+y8aF6uHVfhyE/bIRIWfs90OxlcnKzKcQtgUKroYKfBY/Bx0BAwlKYyTUYIn4nxKvq1VJo1jU5fuxC4mkvocoxXpVljesIiZJjxp+WOYxsSUuBSuB9L/ATnXyDA=

Steps to reproduce

just run the code , in playground it works , but in actual project on running browser (Brave Browser in my case) it works fine but log error

What is expected?

kick the bug !

What is actually happening?

i have a 12 digit number in my app , i want to show it in 43 digitlines format im using string.substring() , but vue js log an error in every refresh that says substring is not a property of string . error : Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'substring')

exact same error logs when i use string.slice ... in my opinion , vue doesn't know Js basic string methods

System Info

Manjaro/Linux - Brave Browser v1.44.112 - PHP/Laravel 9.28.0

Any additional comments?

thanks for Powerful team of VUE.JS ...

avatar
Oct 26th 2022

exact same error logs when i use string.slice ... in my opinion , vue doesn't know Js basic string methods

It rather sounds like a browser issue, or an issue with your app, if it works in the playground.

Since Brave ia built on Chromium, i doubt that Brave doesn't know these basic JS APIs

avatar
Nov 7th 2022

tested in Brave, cannot reproduce.